Skip to main content

Module encoding

Module encoding 

Source

Constants§

B64_CHARS 🔒

Statics§

PERF_TS 🔒

Functions§

atob 🔒
base64_to_bytes 🔒
base64 文字列をバイト列へデコードする共通処理(atob/Uint8Array.fromBase64 で共有)。 未知の文字(改行等)は無視する簡略実装。
btoa 🔒
bytes_to_base64 🔒
バイト列を base64 文字列へエンコードする共通処理(btoa/Uint8Array.prototype.toBase64 で共有)。
bytes_to_hex 🔒
バイト列を小文字16進文字列へエンコードする(Uint8Array.prototype.toHex)。
hex_to_bytes 🔒
16進文字列をバイト列へデコードする(Uint8Array.fromHex)。奇数長や不正文字は None
js_decode_uri 🔒
js_decode_uri_component 🔒
js_encode_uri 🔒
js_encode_uri_component 🔒
js_escape 🔒
escape(str)(Annex B.2.1.1。ES6 で非推奨だが encodeURI 系登場以前からの 遺産として実務コードになお残る)が丸ごと未対応だった。仕様は UTF-16 コード単位ベースだが、この処理系の文字列は UTF-8(Rust String)のため Unicode スカラー値(char)単位で近似する(BMP 外文字のサロゲートペア 分割は考慮しない、他の Unicode 境界処理と同水準の簡略化)。
js_unescape 🔒
unescape(str)(Annex B.2.1.2)。escape の逆変換。%XX/%uXXXX を復元し、 どちらの形にも一致しない % はそのまま素通しする(仕様どおり)。
make_perf_entry 🔒
next_perf_timestamp
performance.now() と同じ単調増加カウンタ(実クロックが無いこの環境の 簡略近似)。Event.timeStamp(イベント生成時刻)にも同じ発生源を使う。
next_rand_u64 🔒
percent_decode 🔒
%XX を1バイトへ復元する共通デコーダ。plus_as_space が true の場合のみ + を空白として扱う(form-urlencoded 用。encodeURIComponent 系では false)。
percent_encode_component 🔒
encodeURIComponent 相当。未エスケープ文字は RFC3986 unreserved + !'()*
percent_encode_uri 🔒
encodeURI 相当。encodeURIComponent の非エスケープ集合に加え、URI 予約文字 (;/?:@&=+$,#) も未エスケープのまま残す(コンポーネントではなくURI全体用のため)。
perf_clear_by_type 🔒
perf_clear_marks 🔒
perf_clear_measures 🔒
perf_entries 🔒
perf_find_mark_time 🔒
perf_get_entries 🔒
perf_get_entries_by_name 🔒
perf_get_entries_by_type 🔒
perf_mark 🔒
performance.mark(name)。呼び出し時点の performance.now()startTime として持つ PerformanceMark エントリを記録して返す。
perf_measure 🔒
performance.measure(name, startMark?, endMark?)。マーク名は performance.mark() で記録済みのエントリから startTime を引く (未指定/未発見の開始マークは時刻 0、終了マークは現在時刻扱い)。
perf_notify_observers 🔒
new PerformanceObserver(callback) が観測中のエントリ種別(observe ({entryTypes:[...]}))に一致する新規エントリを performance.mark/ .measure の記録直後に同期的に通知する(仕様上のマイクロタスク経由の 非同期バッチ通知は簡略化し、エントリ1件ごとに即時コールバックする)。
perf_observer_list_get_entries 🔒
perf_push_entry 🔒
performance_now 🔒
performance_observer_ctor 🔒
new PerformanceObserver(callback)(丸ごと未対応だった)。
performance_observer_disconnect 🔒
observer.disconnect()performance._observers から自身を取り除く。
performance_observer_observe 🔒
observer.observe({entryTypes: [...]})(複数種別・buffered非対応の 従来形式)。監視対象の種別を記録し、performance._observers へ自身を 登録する(同一インスタンスの重複登録は無視する)。
ta_from_base64 🔒
Uint8Array.fromBase64(str)(ES2024/2025 静的メソッド)。
ta_from_hex 🔒
Uint8Array.fromHex(str)(ES2024/2025 静的メソッド)。不正な16進文字列は例外を投げる。
ta_set_from_base64 🔒
Uint8Array.prototype.setFromBase64(str)(ES2024/2025)。
ta_set_from_hex 🔒
Uint8Array.prototype.setFromHex(str)(ES2024/2025)。不正な16進文字列は例外を投げる。
ta_to_base64 🔒
Uint8Array.prototype.toBase64()(ES2024/2025)。
ta_to_bytes 🔒
TypedArray インスタンスの要素を u8 バイト列として取り出す(Uint8Array 専用機能で使用)。
ta_to_hex 🔒
Uint8Array.prototype.toHex()(ES2024/2025)。
ta_write_bytes_into 🔒
デコードしたバイト列を既存の this(Uint8Array)の先頭から上書きし、 { read, written }read は入力文字列の消費文字数、written は書き込んだ バイト数)を返す共通処理。setFromBase64/setFromHex で共有する。 toBase64/toHex(読み取り)と fromBase64/fromHex(新規生成)は 実装済みだったが、既存バッファへインプレースで書き込む対になる setFromBase64/setFromHex(ES2024/2025)が丸ごと未対応だった。