Blob to [Word8]

I stuggle again on some very basic stuff.
How can I convert a Blob to a [Word8] array?
I tried different things but didn’t succed…

import Iter "mo:base/Iter";

func blobToArray(blob : Blob) : [Word8] {
  return Iter.toArray(blob.bytes());
};
3 Likes

Thanks!
Blob.bytes() not documented in the current documentation :wink:

1 Like

It is actually documented here

but not very prominently.

Thanks for reporting!

4 Likes