add support for Uint8Array as input