UNPKG

@csound/browser

Version:

[![npm (scoped with tag)](https://shields.shivering-isles.com/npm/v/@csound/browser/latest)](https://www.npmjs.com/package/@csound/browser) [![GitHub Workflow Status](https://shields.shivering-isles.com/github/workflow/status/csound/csound/csound_wasm)](h

26 lines (21 loc) 600 B
/** * @fileoverview 雑多な関数群をまとめたモジュール実装. */ export function Util() {} /** * Byte String から Byte Array に変換. * @param {!string} string_ * @return {Uint8Array} byte array. */ Util.stringToByteArray = function (string_) { /** @type {!Array.<(string|number)>} */ const temporary = [...string_]; /** @type {number} */ let index; /** @type {number} */ let il; for (index = 0, il = temporary.length; index < il; index++) { temporary[index] = (temporary[index].charPointAt(0) & 0xff) >>> 0; } return new Uint8Array([temporary]); };