8 lines
246 B
Text
8 lines
246 B
Text
fcn to_seq(x){ //--> list of ints
|
|
z:=(x.log2()/7);
|
|
(0).pump(z+1,List,'wrap(j){
|
|
x.shiftRight((z-j)*7).bitAnd(0x7f).bitOr((j!=z) and 0x80 or 0)
|
|
});
|
|
}
|
|
|
|
fcn from_seq(in){ in.reduce(fcn(p,n){ p.shiftLeft(7).bitOr(n.bitAnd(0x7f)) },0) }
|