go-hexadeca/encodeuint16.go

26 lines
865 B
Go
Raw Normal View History

2023-10-27 08:05:41 +00:00
package hexadeca
2023-10-27 18:58:14 +00:00
import (
2023-10-27 20:25:50 +00:00
"sourcecode.social/reiver/go-hexadeca/enc/runes"
2023-10-27 18:58:14 +00:00
"sourcecode.social/reiver/go-hexadeca/symbols/rune"
)
2023-10-27 08:05:41 +00:00
func EncodeUint16(value uint16, symbolFunc func(byte)rune) (r3 rune, r2 rune, r1 rune, r0 rune) {
2023-10-27 20:25:50 +00:00
r3, r2 = hexadecarunes.EncodeByte(byte(0x00ff & (value >> (8 ))), symbolFunc)
r1, r0 = hexadecarunes.EncodeByte(byte(0x00ff & value ), symbolFunc)
2023-10-27 08:05:41 +00:00
return
}
func EncodeUint16UsingLowerCaseSymbols(value uint16) (r3 rune, r2 rune, r1 rune, r0 rune) {
2023-10-27 18:58:14 +00:00
return EncodeUint16(value, runesymbols.LowerCase)
2023-10-27 08:05:41 +00:00
}
func EncodeUint16UsingPersianSymbols(value uint16) (r3 rune, r2 rune, r1 rune, r0 rune) {
2023-10-27 18:58:14 +00:00
return EncodeUint16(value, runesymbols.Persian)
2023-10-27 08:05:41 +00:00
}
func EncodeUint16UsingUpperCaseSymbols(value uint16) (r3 rune, r2 rune, r1 rune, r0 rune) {
2023-10-27 18:58:14 +00:00
return EncodeUint16(value, runesymbols.UpperCase)
2023-10-27 08:05:41 +00:00
}