Skip to content

Commit

Permalink
Update randomness.mdx
Browse files Browse the repository at this point in the history
  • Loading branch information
jessiemongeon1 authored Aug 2, 2024
1 parent 0935bf7 commit ff80933
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ let (randomBytes,): (Vec<u8>,) = ic_cdk::api::call(Principal.management_canister
import { call, IDL, update } from 'azle';

export default class {
@update([], IDL.Nat64)
async createRand(): Promise<bigint> {
const randomInt = await call('aaaaa-aa', 'raw_rand', {
@update([], IDL.Vec(IDL.Nat8))
async randomBytes(): Promise<Uint8Array> {
const bytes: Uint8Array = await call('aaaaa-aa', 'raw_rand', {
returnIdlType: IDL.Vec(IDL.Nat8)
});

return randomInt;
return bytes;
}
}
```
Expand Down

0 comments on commit ff80933

Please sign in to comment.