Skip to content

Commit

Permalink
Deploying to gh-pages from @ a203574 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
bakkot committed Feb 21, 2024
1 parent 16a89e7 commit 95f7a18
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ <h3>Basic usage</h3>

<h3>Options</h3>
<p>The base64 methods take an optional options bag which allows specifying the alphabet as either <code>"base64"</code> (the default) or <code>"base64url"</code> (<a href="https://datatracker.ietf.org/doc/html/rfc4648#section-5">the URL-safe variant</a>).</p>
<p>The base64 decoder also allows specifying the behavior for the final chunk with <code>lastChunkHandling</code>. Recall that base64 decoding operates on chunks of 4 characters at a time, but the input maybe have some characters which don't fit evenly into such a chunk of 4 characters. This option determines how the final chunk of characters should be handled. The three options are <code>"loose"</code> (the default), which treats the chunk as if it had any necessary <code>=</code> padding (but throws if this is not possible, i.e. there is exactly one extra character); <code>"strict"</code>, which enforces that the chunk has exactly 4 characters (counting <code>=</code> padding) and that <a href="https://datatracker.ietf.org/doc/html/rfc4648#section-3.5">overflow bits</a> are 0; and <code>"stop-before-partial"</code>, which stops decoding before the final chunk unless the final chunk has exactly 4 characters.
<p>The base64 decoder also allows specifying the behavior for the final chunk with <code>lastChunkHandling</code>. Recall that base64 decoding operates on chunks of 4 characters at a time, but the input may have some characters which don't fit evenly into such a chunk of 4 characters. This option determines how the final chunk of characters should be handled. The three options are <code>"loose"</code> (the default), which treats the chunk as if it had any necessary <code>=</code> padding (but throws if this is not possible, i.e. there is exactly one extra character); <code>"strict"</code>, which enforces that the chunk has exactly 4 characters (counting <code>=</code> padding) and that <a href="https://datatracker.ietf.org/doc/html/rfc4648#section-3.5">overflow bits</a> are 0; and <code>"stop-before-partial"</code>, which stops decoding before the final chunk unless the final chunk has exactly 4 characters.
<p>The hex methods do not have any options.</p>

<pre class="language-js"><code class="language-js"><span class="token keyword">let</span> array <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Uint8Array</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token number">251</span><span class="token punctuation">,</span> <span class="token number">255</span><span class="token punctuation">,</span> <span class="token number">191</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
Expand Down
2 changes: 1 addition & 1 deletion spec/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</ul></div><div id="menu-toggle"><svg xmlns="http://www.w3.org/2000/svg" style="width:100%; height:100%; stroke:currentColor" viewBox="0 0 120 120">
<title>Menu</title>
<path stroke-width="10" stroke-linecap="round" d="M30,60 h60 M30,30 m0,5 h60 M30,90 m0,-5 h60"></path>
</svg></div><div id="menu-spacer" class="menu-spacer"></div><div id="menu"><div id="menu-search"><input type="text" id="menu-search-box" placeholder="Search..."><div id="menu-search-results" class="inactive"></div></div><div id="menu-pins"><div class="menu-pane-header">Pins</div><ul id="menu-pins-list"></ul></div><div class="menu-pane-header">Table of Contents</div><div id="menu-toc"><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-uint8array.prototype.tobase64" title="Uint8Array.prototype.toBase64 ( [ options ] )"><span class="secnum">1</span> Uint8Array.prototype.toBase64 ( [ <var>options</var> ] )</a></li><li><span class="item-toggle-none"></span><a href="#sec-uint8array.prototype.tohex" title="Uint8Array.prototype.toHex ( )"><span class="secnum">2</span> Uint8Array.prototype.toHex ( )</a></li><li><span class="item-toggle-none"></span><a href="#sec-uint8array.frombase64" title="Uint8Array.fromBase64 ( string [ , options ] )"><span class="secnum">3</span> Uint8Array.fromBase64 ( <var>string</var> [ , <var>options</var> ] )</a></li><li><span class="item-toggle-none"></span><a href="#sec-uint8array.prototype.setfrombase64" title="Uint8Array.prototype.setFromBase64 ( string [ , options ] )"><span class="secnum">4</span> Uint8Array.prototype.setFromBase64 ( <var>string</var> [ , <var>options</var> ] )</a></li><li><span class="item-toggle-none"></span><a href="#sec-uint8array.fromhex" title="Uint8Array.fromHex ( string )"><span class="secnum">5</span> Uint8Array.fromHex ( <var>string</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-uint8array.prototype.setfromhex" title="Uint8Array.prototype.setFromHex ( string )"><span class="secnum">6</span> Uint8Array.prototype.setFromHex ( <var>string</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-validateuint8array" title="ValidateUint8Array ( ta )"><span class="secnum">7</span> ValidateUint8Array ( <var>ta</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-getuint8arraybytes" title="GetUint8ArrayBytes ( ta )"><span class="secnum">8</span> GetUint8ArrayBytes ( <var>ta</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-writeuint8arraybytes" title="SetUint8ArrayBytes ( into, bytes )"><span class="secnum">9</span> SetUint8ArrayBytes ( <var>into</var>, <var>bytes</var> )</a></li><li><span class="item-toggle">+</span><a href="#sec-helpers" title="Helpers"><span class="secnum">10</span> Helpers</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-skipasciiwhitespace" title="SkipAsciiWhitespace ( string, index )"><span class="secnum">10.1</span> SkipAsciiWhitespace ( <var>string</var>, <var>index</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-decodebase64chunk" title="DecodeBase64Chunk ( chunk [ , throwOnExtraBits ] )"><span class="secnum">10.2</span> DecodeBase64Chunk ( <var>chunk</var> [ , <var>throwOnExtraBits</var> ] )</a></li><li><span class="item-toggle-none"></span><a href="#sec-frombase64" title="FromBase64 ( string, alphabet, lastChunkHandling [ , maxLength ] )"><span class="secnum">10.3</span> FromBase64 ( <var>string</var>, <var>alphabet</var>, <var>lastChunkHandling</var> [ , <var>maxLength</var> ] )</a></li><li><span class="item-toggle-none"></span><a href="#sec-fromhex" title="FromHex ( string [ , maxLength ] )"><span class="secnum">10.4</span> FromHex ( <var>string</var> [ , <var>maxLength</var> ] )</a></li><li><span class="item-toggle-none"></span><a href="#sec-getoptionsobject" title="GetOptionsObject ( options )"><span class="secnum">10.5</span> GetOptionsObject ( <var>options</var> )</a></li></ol></li><li><span class="item-toggle-none"></span><a href="#sec-modified-bibliography" title="Bibliography"><span class="secnum">A</span> Bibliography</a></li></ol></div></div><div id="spec-container"><h1 class="version">Stage 2 Draft / February 7, 2024</h1><h1 class="title">Uint8Array to/from base64</h1>
</svg></div><div id="menu-spacer" class="menu-spacer"></div><div id="menu"><div id="menu-search"><input type="text" id="menu-search-box" placeholder="Search..."><div id="menu-search-results" class="inactive"></div></div><div id="menu-pins"><div class="menu-pane-header">Pins</div><ul id="menu-pins-list"></ul></div><div class="menu-pane-header">Table of Contents</div><div id="menu-toc"><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-uint8array.prototype.tobase64" title="Uint8Array.prototype.toBase64 ( [ options ] )"><span class="secnum">1</span> Uint8Array.prototype.toBase64 ( [ <var>options</var> ] )</a></li><li><span class="item-toggle-none"></span><a href="#sec-uint8array.prototype.tohex" title="Uint8Array.prototype.toHex ( )"><span class="secnum">2</span> Uint8Array.prototype.toHex ( )</a></li><li><span class="item-toggle-none"></span><a href="#sec-uint8array.frombase64" title="Uint8Array.fromBase64 ( string [ , options ] )"><span class="secnum">3</span> Uint8Array.fromBase64 ( <var>string</var> [ , <var>options</var> ] )</a></li><li><span class="item-toggle-none"></span><a href="#sec-uint8array.prototype.setfrombase64" title="Uint8Array.prototype.setFromBase64 ( string [ , options ] )"><span class="secnum">4</span> Uint8Array.prototype.setFromBase64 ( <var>string</var> [ , <var>options</var> ] )</a></li><li><span class="item-toggle-none"></span><a href="#sec-uint8array.fromhex" title="Uint8Array.fromHex ( string )"><span class="secnum">5</span> Uint8Array.fromHex ( <var>string</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-uint8array.prototype.setfromhex" title="Uint8Array.prototype.setFromHex ( string )"><span class="secnum">6</span> Uint8Array.prototype.setFromHex ( <var>string</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-validateuint8array" title="ValidateUint8Array ( ta )"><span class="secnum">7</span> ValidateUint8Array ( <var>ta</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-getuint8arraybytes" title="GetUint8ArrayBytes ( ta )"><span class="secnum">8</span> GetUint8ArrayBytes ( <var>ta</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-writeuint8arraybytes" title="SetUint8ArrayBytes ( into, bytes )"><span class="secnum">9</span> SetUint8ArrayBytes ( <var>into</var>, <var>bytes</var> )</a></li><li><span class="item-toggle">+</span><a href="#sec-helpers" title="Helpers"><span class="secnum">10</span> Helpers</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-skipasciiwhitespace" title="SkipAsciiWhitespace ( string, index )"><span class="secnum">10.1</span> SkipAsciiWhitespace ( <var>string</var>, <var>index</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-decodebase64chunk" title="DecodeBase64Chunk ( chunk [ , throwOnExtraBits ] )"><span class="secnum">10.2</span> DecodeBase64Chunk ( <var>chunk</var> [ , <var>throwOnExtraBits</var> ] )</a></li><li><span class="item-toggle-none"></span><a href="#sec-frombase64" title="FromBase64 ( string, alphabet, lastChunkHandling [ , maxLength ] )"><span class="secnum">10.3</span> FromBase64 ( <var>string</var>, <var>alphabet</var>, <var>lastChunkHandling</var> [ , <var>maxLength</var> ] )</a></li><li><span class="item-toggle-none"></span><a href="#sec-fromhex" title="FromHex ( string [ , maxLength ] )"><span class="secnum">10.4</span> FromHex ( <var>string</var> [ , <var>maxLength</var> ] )</a></li><li><span class="item-toggle-none"></span><a href="#sec-getoptionsobject" title="GetOptionsObject ( options )"><span class="secnum">10.5</span> GetOptionsObject ( <var>options</var> )</a></li></ol></li><li><span class="item-toggle-none"></span><a href="#sec-modified-bibliography" title="Bibliography"><span class="secnum">A</span> Bibliography</a></li></ol></div></div><div id="spec-container"><h1 class="version">Stage 3 Draft / February 21, 2024</h1><h1 class="title">Uint8Array to/from base64</h1>

<div id="metadata-block">
<h1>Contributing to this Proposal</h1>
Expand Down

0 comments on commit 95f7a18

Please sign in to comment.