mirror of
https://github.com/grishka/NearDrop.git
synced 2026-04-03 01:36:15 +02:00
@@ -21,6 +21,13 @@ extension Data{
|
||||
})
|
||||
}
|
||||
|
||||
func suffixOfAtMost(numBytes:Int) -> Data{
|
||||
if count<=numBytes{
|
||||
return self;
|
||||
}
|
||||
return subdata(in: count-numBytes..<count)
|
||||
}
|
||||
|
||||
static func randomData(length: Int) -> Data{
|
||||
var data=Data(count: length)
|
||||
data.withUnsafeMutableBytes {
|
||||
|
||||
Reference in New Issue
Block a user