correction

master
Charles Iliya Krempeaux 2023-10-27 11:42:26 -07:00
parent 23a26d620a
commit 929e078111
1 changed files with 11 additions and 2 deletions

View File

@ -11,15 +11,20 @@ package hexadeca
//
// If value was 254 (== 0xFE) then mostSignificiant would be 'f' and and leastSignificant would be 'e'.
func SymbolLowerCase(value byte) rune {
return rune(symbolLowerCase(value))
}
func symbolLowerCase(value byte) byte {
const table string = "0123456789abcdef"
var index int = int(value) % len(table)
var result rune = rune(table[index])
var result byte = table[index]
return result
}
// SymbolPersian is used with hexadeca.EncodeByte() to encode a byte into hexadecimal symbols using Persian symbols from Unicode UTF-8.
// I.e.,
//
@ -68,11 +73,15 @@ func SymbolPersian(value byte) rune {
//
// If value was 254 (== 0xFE) then mostSignificiant would be 'F' and and leastSignificant would be 'E'.
func SymbolUpperCase(value byte) rune {
return rune(symbolUpperCase(value))
}
func symbolUpperCase(value byte) byte {
const table string = "0123456789ABCDEF"
var index int = int(value) % len(table)
var result rune = rune(table[index])
var result byte = table[index]
return result
}