Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,28 @@
|
|||
F to_str(v)
|
||||
R ‘[ ’v.map(n -> hex(n).lowercase().zfill(2)).join(‘ ’)‘ ]’
|
||||
|
||||
F to_seq(UInt64 x)
|
||||
V i = 0
|
||||
L(ii) (9.<0).step(-1)
|
||||
I x [&] (UInt64(127) << ii * 7) != 0
|
||||
i = ii
|
||||
L.break
|
||||
|
||||
[Byte] out
|
||||
L(j) 0 .. i
|
||||
out [+]= ((x >> ((i - j) * 7)) [&] 127) [|] 128
|
||||
|
||||
out[i] (+)= 128
|
||||
R out
|
||||
|
||||
F from_seq(seq)
|
||||
UInt64 r = 0
|
||||
|
||||
L(b) seq
|
||||
r = (r << 7) [|] (b [&] 127)
|
||||
|
||||
R r
|
||||
|
||||
L(x) [UInt64(7'F), 40'00, 0, 003F'FFFE, 001F'FFFF, 0020'0000, 3311'A123'4DF3'1413]
|
||||
V s = to_seq(x)
|
||||
print(‘seq from ’hex(x).lowercase()‘ ’to_str(s)‘ back: ’hex(from_seq(s)).lowercase())
|
||||
Loading…
Add table
Add a link
Reference in a new issue