Differences From Artifact [9b6529621c]:
- File crypt.t — part of check-in [d228cd7fcb] at 2020-12-28 23:42:22 on branch trunk — vastly improve the setup process (user: lexi, size: 6250) [annotate] [blame] [check-ins using]
To Artifact [f5b057e4fa]:
- File crypt.t — part of check-in [87731d4007] at 2020-12-29 14:35:10 on branch trunk — add ipc backbone (user: lexi, size: 6289) [annotate] [blame] [check-ins using]
58 58 for i=0,sz do dest[i] = [uint8](rnd()) end 59 59 return sz 60 60 end 61 61 end 62 62 63 63 m.random = macro(function(typ, from, to) 64 64 local ty = typ:astype() 65 + from = from or 0 66 + to = to or ty:max() 65 67 return quote 66 68 var v: ty 67 69 m.spray([&uint8](&v), sizeof(ty)) 68 70 v = v % (to - from) + from -- only works with unsigned!! 69 71 in v end 70 72 end) 71 73