Skip to content
This repository was archived by the owner on Feb 25, 2019. It is now read-only.

Fix reference to TextEncoder TextDecoder #14

Open
wants to merge 1 commit into
base: webcrypto-api
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/ab-utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-env es6 */
/* global TextEncoderLite, TextDecoderLite */
/* global TextEncoder, TextDecoder */

import * as base64 from 'base64-js'
import 'text-encoder-lite'
Expand Down Expand Up @@ -52,11 +52,11 @@ export function hex2ab (hexstr) {
// conversions.

export function str2utf8ab (str) {
return new TextEncoderLite('utf-8').encode(str)
return new TextEncoder('utf-8').encode(str)
}

export function abutf82str (ab) {
return new TextDecoderLite('utf-8').decode(ab)
return new TextDecoder('utf-8').decode(ab)
}

export function str2ab (str) {
Expand Down