Compare commits
2 Commits
7a6f2d8e50
...
e3525d18ec
Author | SHA1 | Date |
---|---|---|
Charles Iliya Krempeaux | e3525d18ec | |
Charles Iliya Krempeaux | b4377f1805 |
|
@ -0,0 +1,20 @@
|
||||||
|
package hexadeca
|
||||||
|
|
||||||
|
func EncodeUint16(value uint16, symbolFunc func(byte)rune) (r3 rune, r2 rune, r1 rune, r0 rune) {
|
||||||
|
r3, r2 = EncodeByte(byte(0x00ff & (value >> (8 ))), symbolFunc)
|
||||||
|
r1, r0 = EncodeByte(byte(0x00ff & value ), symbolFunc)
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func EncodeUint16UsingLowerCaseSymbols(value uint16) (r3 rune, r2 rune, r1 rune, r0 rune) {
|
||||||
|
return EncodeUint16(value, SymbolLowerCase)
|
||||||
|
}
|
||||||
|
|
||||||
|
func EncodeUint16UsingPersianSymbols(value uint16) (r3 rune, r2 rune, r1 rune, r0 rune) {
|
||||||
|
return EncodeUint16(value, SymbolPersian)
|
||||||
|
}
|
||||||
|
|
||||||
|
func EncodeUint16UsingUpperCaseSymbols(value uint16) (r3 rune, r2 rune, r1 rune, r0 rune) {
|
||||||
|
return EncodeUint16(value, SymbolUpperCase)
|
||||||
|
}
|
|
@ -1,10 +1,10 @@
|
||||||
package hexadeca
|
package hexadeca
|
||||||
|
|
||||||
func EncodeUint32(value uint32, symbolFunc func(byte)rune) (r7 rune, r6 rune, r5 rune, r4 rune, r3 rune, r2 rune, r1 rune, r0 rune) {
|
func EncodeUint32(value uint32, symbolFunc func(byte)rune) (r7 rune, r6 rune, r5 rune, r4 rune, r3 rune, r2 rune, r1 rune, r0 rune) {
|
||||||
r7, r6 = EncodeByte(byte(0x00000000000000ff & (value >> (8 * 3))), symbolFunc)
|
r7, r6 = EncodeByte(byte(0x000000ff & (value >> (8 * 3))), symbolFunc)
|
||||||
r5, r4 = EncodeByte(byte(0x00000000000000ff & (value >> (8 * 2))), symbolFunc)
|
r5, r4 = EncodeByte(byte(0x000000ff & (value >> (8 * 2))), symbolFunc)
|
||||||
r3, r2 = EncodeByte(byte(0x00000000000000ff & (value >> (8 ))), symbolFunc)
|
r3, r2 = EncodeByte(byte(0x000000ff & (value >> (8 ))), symbolFunc)
|
||||||
r1, r0 = EncodeByte(byte(0x00000000000000ff & value ), symbolFunc)
|
r1, r0 = EncodeByte(byte(0x000000ff & value ), symbolFunc)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue