initial commits
parent
d3a413c214
commit
e6846604bb
|
@ -0,0 +1,22 @@
|
|||
package hexadecabytes
|
||||
|
||||
import (
|
||||
"sourcecode.social/reiver/go-hexadeca/symbols/byte"
|
||||
)
|
||||
|
||||
func EncodeInt32(value int32, symbolFunc func(byte)byte) (r7 byte, r6 byte, r5 byte, r4 byte, r3 byte, r2 byte, r1 byte, r0 byte) {
|
||||
r7, r6 = EncodeByte(byte(0x000000ff & (value >> (8 * 3))), symbolFunc)
|
||||
r5, r4 = EncodeByte(byte(0x000000ff & (value >> (8 * 2))), symbolFunc)
|
||||
r3, r2 = EncodeByte(byte(0x000000ff & (value >> (8 ))), symbolFunc)
|
||||
r1, r0 = EncodeByte(byte(0x000000ff & value ), symbolFunc)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func EncodeInt32UsingLowerCaseSymbols(value int32) (r7 byte, r6 byte, r5 byte, r4 byte, r3 byte, r2 byte, r1 byte, r0 byte) {
|
||||
return EncodeInt32(value, bytesymbols.LowerCase)
|
||||
}
|
||||
|
||||
func EncodeInt32UsingUpperCaseSymbols(value int32) (r7 byte, r6 byte, r5 byte, r4 byte, r3 byte, r2 byte, r1 byte, r0 byte) {
|
||||
return EncodeInt32(value, bytesymbols.UpperCase)
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package hexadeca
|
||||
|
||||
import (
|
||||
"sourcecode.social/reiver/go-hexadeca/bytes"
|
||||
"sourcecode.social/reiver/go-hexadeca/runes"
|
||||
)
|
||||
|
||||
func EncodeInt32UsingLowerCaseSymbols(value int32) (r7 byte, r6 byte, r5 byte, r4 byte, r3 byte, r2 byte, r1 byte, r0 byte) {
|
||||
return hexadecabytes.EncodeInt32UsingLowerCaseSymbols(value)
|
||||
}
|
||||
|
||||
func EncodeInt32UsingPersianSymbols(value int32) (r7 rune, r6 rune, r5 rune, r4 rune, r3 rune, r2 rune, r1 rune, r0 rune) {
|
||||
return hexadecarunes.EncodeInt32UsingPersianSymbols(value)
|
||||
}
|
||||
|
||||
func EncodeInt32UsingUpperCaseSymbols(value int32) (r7 byte, r6 byte, r5 byte, r4 byte, r3 byte, r2 byte, r1 byte, r0 byte) {
|
||||
return hexadecabytes.EncodeInt32UsingUpperCaseSymbols(value)
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package hexadecarunes
|
||||
|
||||
import (
|
||||
"sourcecode.social/reiver/go-hexadeca/symbols/rune"
|
||||
)
|
||||
|
||||
func EncodeInt32(value int32, symbolFunc func(byte)rune) (r7 rune, r6 rune, r5 rune, r4 rune, r3 rune, r2 rune, r1 rune, r0 rune) {
|
||||
r7, r6 = EncodeByte(byte(0x000000ff & (value >> (8 * 3))), symbolFunc)
|
||||
r5, r4 = EncodeByte(byte(0x000000ff & (value >> (8 * 2))), symbolFunc)
|
||||
r3, r2 = EncodeByte(byte(0x000000ff & (value >> (8 ))), symbolFunc)
|
||||
r1, r0 = EncodeByte(byte(0x000000ff & value ), symbolFunc)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func EncodeInt32UsingLowerCaseSymbols(value int32) (r7 rune, r6 rune, r5 rune, r4 rune, r3 rune, r2 rune, r1 rune, r0 rune) {
|
||||
return EncodeInt32(value, runesymbols.LowerCase)
|
||||
}
|
||||
|
||||
func EncodeInt32UsingPersianSymbols(value int32) (r7 rune, r6 rune, r5 rune, r4 rune, r3 rune, r2 rune, r1 rune, r0 rune) {
|
||||
return EncodeInt32(value, runesymbols.Persian)
|
||||
}
|
||||
|
||||
func EncodeInt32UsingUpperCaseSymbols(value int32) (r7 rune, r6 rune, r5 rune, r4 rune, r3 rune, r2 rune, r1 rune, r0 rune) {
|
||||
return EncodeInt32(value, runesymbols.UpperCase)
|
||||
}
|
Loading…
Reference in New Issue