go-hexadeca/runes/encodeint8.go

27 lines
819 B
Go
Raw Permalink Normal View History

2023-10-28 20:34:58 +00:00
package hexadecarunes
import (
2024-07-25 11:33:45 +00:00
"github.com/reiver/go-hexadeca/symbols/rune"
2023-10-28 20:34:58 +00:00
)
// EncodeInt8 encodes the value of a int8 into hexadecimal.
func EncodeInt8(value int8, symbolFunc func(byte)rune) (mostSignificant rune, leastSignificant rune) {
mostSignificant = symbolFunc( byte(0x0f & (value >> 4)) )
leastSignificant = symbolFunc( byte(0x0f & (value )) )
return
}
func EncodeInt8UsingLowerCaseSymbols(value int8) (mostSignificant rune, leastSignificant rune) {
return EncodeInt8(value, runesymbols.LowerCase)
}
func EncodeInt8UsingPersianSymbols(value int8) (mostSignificant rune, leastSignificant rune) {
return EncodeInt8(value, runesymbols.Persian)
}
func EncodeInt8UsingUpperCaseSymbols(value int8) (mostSignificant rune, leastSignificant rune) {
return EncodeInt8(value, runesymbols.UpperCase)
}