This commit is contained in:
Dmitriy Ryajov 2024-02-01 19:01:39 -06:00
parent c5c60ba9ff
commit e8693b7b66
No known key found for this signature in database
GPG Key ID: DA8C680CE7C657A4
1 changed files with 6 additions and 7 deletions

View File

@ -11,19 +11,18 @@ type
RandomChunker* = Chunker
proc new*(
T: type RandomChunker,
rng: Rng,
chunkSize: int | NBytes,
size: int | NBytes,
pad = false
): RandomChunker =
T: type RandomChunker,
rng: Rng,
chunkSize: int | NBytes,
size: int | NBytes,
pad = false): RandomChunker =
## Create a chunker that produces random data
##
let
size = size.int
chunkSize = chunkSize.NBytes
var consumed = 0
proc reader(data: ChunkBuffer, len: int): Future[int]
{.async, gcsafe, raises: [Defect].} =