Search completed in 2.24 seconds.
333 results for "encoded":
Your results are loading. Please wait...
PerformanceResourceTiming.encodedBodySize - Web APIs
the encodedbodysize read-only property represents the size (in octets) received from the fetch (http or cache), of the payload body, before removing any applied content-codings.
... syntax resource.encodedbodysize; return value a number representing the size (in octets) received from the fetch (http or cache), of the payload body, before removing any applied content-codings.
... if ("decodedbodysize" in perfentry) console.log("decodedbodysize = " + perfentry.decodedbodysize); else console.log("decodedbodysize = not supported"); if ("encodedbodysize" in perfentry) console.log("encodedbodysize = " + perfentry.encodedbodysize); else console.log("encodedbodysize = not supported"); if ("transfersize" in perfentry) console.log("transfersize = " + perfentry.transfersize); else console.log("transfersize = not supported"); } function check_performanceentries() { // use getentriesbytype() to just get the "resource" ev...
...ents var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { log_sizes(p[i]); } } specifications specification status comment resource timing level 2the definition of 'encodedbodysize' in that specification.
RTCOutboundRtpStreamStats.framesEncoded - Web APIs
the framesencoded property of the rtcoutboundrtpstreamstats dictionary indicates the total number of frames that have been encoded by this rtcrtpsender for this media source.
... syntax var framesencoded = rtcoutboundrtpstreamstats.framesencoded; value an integer value indicating the total number of video frames that this sender has encoded so far for this stream.
... specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcoutboundrtpstreamstats.framesencoded' in that specification.
StringView - Archive of obsolete content
awhole.subarray(nstartidx, nendidx) : awhole; } this.buffer = awhole.buffer; this.bufferview = awhole; this.rawdata = araw; object.freeze(this); } /* constructor's methods */ stringview.loadutf8charcode = function (achars, nidx) { /* the iso 10646 view of utf-8 considers valid codepoints encoded by 1-6 bytes, * while the unicode view of utf-8 in 2003 has limited them to 1-4 bytes in order to * match utf-16's codepoints.
...d!" var mystringview2 = new stringview(mystringview1, "utf-16"); alert(mystringview1.buffer.bytelength); // 12 alert(mystringview2.buffer.bytelength); // 24 stringview constructor's methods makefrombase64() syntax stringview.makefrombase64(base64string[, encoding][, byteoffset][, length]) description returns a new instance of stringview constructed decoding a given base64-encoded string.
... arguments base64string (required) a base64-encoded string which will be decoded and copied into the new stringview object.
...And 22 more matches
Web audio codec guide - Web media technologies
factors affecting the encoded audio there are two general categories of factors that affect the encoded audio which is output by an audio codec's encoder: details about the source audio's format and contents, and the codec and its configuration during the encoding process.
... for each factor that affects the encoded audio, there is a simple rule that is nearly always true: because the fidelity of digital audio is determined by the granularity and precision of the samples taken to convert it into a data stream, the more data used to represent the digital version of the audio, the more closely the sampled sound will match the source material.
... the effect of source audio format on encoded audio output because encoded audio inherently uses fewer bits to represent each sample, the source audio format may actually have less impact on the encoded audio size than one might expect.
...And 21 more matches
Web video codec guide - Web media technologies
c (h.265) high efficiency video coding mp4 mp4v-es mpeg-4 video elemental stream 3gp, mp4 mpeg-1 mpeg-1 part 2 visual mpeg, quicktime mpeg-2 mpeg-2 part 2 visual mp4, mpeg, quicktime theora theora ogg vp8 video processor 8 3gp, ogg, webm vp9 video processor 9 mp4, ogg, webm factors affecting the encoded video as is the case with any encoder, there are two basic groups of factors affecting the size and quality of the encoded video: specifics about the source video's format and contents, and the characteristics and configuration of the codec used while encoding the video.
... the simplest guideline is this: anything that makes the encoded video look more like the original, uncompressed, video will generally make the resulting data larger as well.
... effect of source video format on encoded output the degree to which the format of the source video will affect the output varies depending on the codec and how it works.
...And 12 more matches
SubtleCrypto.importKey() - Web APIs
the pkcs #8 format is defined in rfc 5208., using the asn.1 notation: privatekeyinfo ::= sequence { version version, privatekeyalgorithm privatekeyalgorithmidentifier, privatekey privatekey, attributes [0] implicit attributes optional } the importkey() method expects to receive this object as an arraybuffer containing the der-encoded form of the privatekeyinfo.
...it consists of a header and a footer, and in between, the base64-encoded binary data.
... a pem-encoded privatekeyinfo looks like this: -----begin private key----- mig2ageambagbyqgsm49agegbsubbaaibigemigbagebbdau9bd0jxdff5ov380z 9vieun2w5kjdz3hbuadencxliamsoquktffaou71eldn0tshzaniaarmuhcee/cp xmjgc1roj0d0k6vluqta+jvcwigxciaukoethcngzdkcrd4pkxdbvbcijdzkvo+l ml2fikoovzh/8yetkmjumb804g6omjuc9vvojcrv0ydasmykkjmjblg= -----end private key----- to get this into a format you can give to importkey() you need to do two things: base64-decode the part between header and footer, using window.atob().
...And 10 more matches
nsIFile
the preferred form operates on utf-16 encoded characters strings.
... an alternate form operates on characters strings encoded in the "native" charset.
... a string containing characters encoded in the native charset cannot be safely passed to javascript via xpconnect.
...And 9 more matches
Index - Web APIs
WebAPIIndex
763 binary strings dom, javascript, javascript typed arrays, reference, string javascript strings are utf-16 encoded strings.
...at that time, the result attribute contains the data as a data: url representing the file's data as a base64 encoded string.
... 2301 transcoding assets for media source extensions dash, dynamic adaptive streaming over http, encoding, mse, media source extensions, adaptive with your video properly encoded and adaptive bitrate media generated, you're now ready to begin adaptive bitrate streaming on the web using dash and mse.
...And 9 more matches
SubtleCrypto.verify() - Web APIs
*/ function getmessageencoding() { const messagebox = document.queryselector(".rsassa-pkcs1 #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } /* fetch the encoded message-to-sign and verify it against the stored signature.
...*/ async function verifymessage(publickey) { const signaturevalue = document.queryselector(".rsassa-pkcs1 .signature-value"); signaturevalue.classlist.remove("valid", "invalid"); let encoded = getmessageencoding(); let result = await window.crypto.subtle.verify( "rsassa-pkcs1-v1_5", publickey, signature, encoded ); signaturevalue.classlist.add(result ?
...*/ function getmessageencoding() { const messagebox = document.queryselector(".rsa-pss #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } /* fetch the encoded message-to-sign and verify it against the stored signature.
...And 5 more matches
Using XMLHttpRequest - Web APIs
a brief introduction to the submit methods an html <form> can be sent in four ways: using the post method and setting the enctype attribute to application/x-www-form-urlencoded (default); using the post method and setting the enctype attribute to text/plain; using the post method and setting the enctype attribute to multipart/form-data; using the get method (in this case the enctype attribute will be ignored).
...if you are using the post method the server will receive a string similar to one of the following three examples, depending on the encoding type you are using: method: post; encoding type: application/x-www-form-urlencoded (default): content-type: application/x-www-form-urlencoded foo=bar&baz=the+first+line.%0d%0athe+second+line.%0d%0a method: post; encoding type: text/plain: content-type: text/plain foo=bar baz=the first line.
...-data */ var sboundary = "---------------------------" + date.now().tostring(16); oajaxreq.setrequestheader("content-type", "multipart\/form-data; boundary=" + sboundary); oajaxreq.sendasbinary("--" + sboundary + "\r\n" + odata.segments.join("--" + sboundary + "\r\n") + "--" + sboundary + "--\r\n"); } else { /* enctype is application/x-www-form-urlencoded or text/plain */ oajaxreq.setrequestheader("content-type", odata.contenttype); oajaxreq.send(odata.segments.join(odata.technique === 2 ?
...And 5 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
the old netscape 4.x the file is encoded (byte-shift/rotary is 7), and the presence of the file (netscape.cfg) in the mozilla_home directory suffices for it to be read and executed.
...so now you only need to create a small encoded cfg file making a call to a web located cgi script which will actually generate the javascript configuration directives to the mozilla client.
...etscape 4.x uses a byte-shift of 7 # to decode: moz-byteshift.pl -s -7 <netscape.cfg >netscape.cfg.txt # to encode: moz-byteshift.pl -s 7 <netscape.cfg.txt >netscape.cfg # mozilla uses a byte-shift of 13 # to decode: moz-byteshift.pl -s -13 <netscape.cfg >netscape.cfg.txt # to encode: moz-byteshift.pl -s 13 <netscape.cfg.txt >netscape.cfg # to activate the netscape.cfg file, place the encoded netscape.cfg file # into your c:\program files\mozilla.org\mozilla directory.
...And 4 more matches
TextEncoder.prototype.encodeInto() - Web APIs
the textencoder.prototype.encodeinto() method takes a usvstring to encode and a destination uint8array to put resulting utf-8 encoded text into, and returns a dictionary object indicating the progress of the encoding.
... uint8array is a uint8array object instance to place the resulting utf-8 encoded text into.
...length) u8array[stats.written] = 0; // append null if room return stats; } examples <p class="source">this is a sample paragraph.</p> <p class="result"></p> const sourcepara = document.queryselector('.source'); const resultpara = document.queryselector('.result'); const string = sourcepara.textcontent; const textencoder = new textencoder(); const utf8 = new uint8array(string.length); let encodedresults = textencoder.encodeinto(string, utf8); resultpara.textcontent += 'bytes read: ' + encodedresults.read + ' | bytes written: ' + encodedresults.written + ' | encoded result: ' + utf8; polyfill the polyfill below may be a bit long because of the switch cases and utilization of native textencoder.prototype.encode in safari when available...
...And 4 more matches
Digital audio concepts - Web media technologies
representing audio in digital form involves a number of steps and processes, with multiple formats available both for the raw audio and the encoded or compressed audio which is actually used on the web.
... the type of content being encoded can affect the choice of codec.
...when using a lossy encoder, the higher the quality, the larger the encoded audio will be.
...And 4 more matches
Sending forms through JavaScript - Learn web development
form data (application/x-www-form-urlencoded) is made of url-encoded lists of key/value pairs.
... let's look at an example: <button>click me!</button> and now the javascript: const btn = document.queryselector('button'); function senddata( data ) { console.log( 'sending data' ); const xhr = new xmlhttprequest(); let urlencodeddata = "", urlencodeddatapairs = [], name; // turn the data object into an array of url-encoded key/value pairs.
... for( name in data ) { urlencodeddatapairs.push( encodeuricomponent( name ) + '=' + encodeuricomponent( data[name] ) ); } // combine the pairs into a single string and replace all %-encoded spaces to // the '+' character; matches the behaviour of browser form submissions.
...And 3 more matches
Client-Server Overview - Learn web development
additional information can be encoded with the request (for example, html form data).
... information can be encoded as: url parameters: get requests encode data in the url sent to the server by adding name/value pairs onto the end of it — for example http://mysite.com?name=fred&age=11.
...post requests add new resources, the data for which is encoded within the request body.
...And 3 more matches
Mozilla internal string guide
char* tonewutf8string(nsastring&) - allocates a new char* buffer containing the utf-8 encoded version of the given nsastring.
...drag&drop) where it's necessary to call a system api with data encoded in the windows locale-dependent legacy encoding instead of utf-16.
...we only support utf-8-encoded file paths on *nix, non-path gtk strings are always utf-8 and cocoa and java strings are always utf-16.
...And 3 more matches
nsIIDNService
autf8string convertacetoutf8( in acstring input ); parameters input the ace encoded hostname to convert into utf-8 format.
... return value the utf-8 encoded equivalent of the hostname.
...isascii on return, this is set to true if the result is ascii or ace encoded; otherwise it's false.
...And 3 more matches
nsIMimeConverter
method overview string encodemimepartiistr(in string header, in boolean structured, in string mailcharset, in long fieldnamelen, in long encodedwordsize); string encodemimepartiistr_utf8(in autf8string header, in boolean structured, in string mailcharset, in long fieldnamelen, in long encodedwordsize); string decodemimeheadertocharptr(in string header, in string default_charset, in boolean override_charset, in boolean eatcontinuations); astring decodemimeheader(in string header, in string default_charset, in boolean override_charset, in boolean eatcontinuations); mimeenc...
... string encodemimepartiistr(in string header, in boolean structured, in string mailcharset, in long fieldnamelen, in long encodedwordsize); parameters propertyname the name of the property to retrieve.
... encodemimepartiistr_utf8() encodes a string into a mime-encoded form according to rfc 2047.
...And 3 more matches
Base64 - MDN Web Docs Glossary: Definitions of Web-related terms
in javascript there are two functions respectively for decoding and encoding base64 strings: btoa(): creates a base-64 encoded ascii string from a "string" of binary data ("btoa" should be read as "binary to ascii").
... atob(): decodes a base64 encoded string("atob" should be read as "ascii to binary").
... encoded size increase each base64 digit represents exactly 6 bits of data.
...And 2 more matches
NSS Certificate Download Specification
they are: der encoded certificate: this is a single binary der encoded certificate.
...this data must be base64 encoded as described by rfc 1113.
...between those two lines, there must be exactly one item of any of the supported binary formats described above, and that one item must be base64 encoded.
...And 2 more matches
Index
data described as pem is a base64 encoded presentation of der, usually wrapped between human readable begin/end lines.
...if located in file it should be encoded in asn.1 encode format.
... synopsis signtool -a | -v -d directory [-a] [-i input_file] [-o output_file] [-s signature_file] [-v] description the signature verification tool, signver, is a simple command-line utility that unpacks a base-64-encoded pkcs#7 signed object and verifies the digital signature using standard cryptographic techniques.
...And 2 more matches
NSS Key Log Format
<clientrandom> is 32 bytes random value from the client hello message, encoded as 64 hexadecimal characters.
... the following labels are defined, followed by a description of the secret: rsa: 48 bytes for the premaster secret, encoded as 96 hexadecimal characters (removed in nss 3.34) client_random: 48 bytes for the master secret, encoded as 96 hexadecimal characters (for ssl 3.0, tls 1.0, 1.1 and 1.2) client_early_traffic_secret: the hex-encoded early traffic secret for the client side (for tls 1.3) client_handshake_traffic_secret: the hex-encoded handshake traffic secret for the client side (for tls 1.3) server_handshake_traffic_secret: the hex-encoded handshake traffic secret for the server side (for tls 1.3) client_traffic_secret_0: the first hex-encoded application traffic secret for the client side (for tls 1.3) server_traffic_secret_0: the firs...
...t hex-encoded application traffic secret for the server side (for tls 1.3) early_exporter_secret: the hex-encoded early exporter secret (for tls 1.3, used for 0-rtt keys in older quic drafts).
...And 2 more matches
nsIStructuredCloneContainer
you can also get a base-64-encoded string containing a copy of the container's serialized data, using getdataasbase64().
...getdataasbase64() get this structured clone container's data as a base-64-encoded string.
...return value a base-64-encoded string.
...And 2 more matches
CData
8-bit strings are assumed to be encoded as utf-8.
... if the 8-bit string contains invalid encoded character, a typeerror exception is thrown.
... 8-bit strings are assumed to be encoded as utf-8.
...And 2 more matches
RTCOutboundRtpStreamStats - Web APIs
framesencoded the number of frames that have been successfully encoded so far for sending on this rtp stream.
... plicount an integer specifying the number of times the remote receiver has notified this rtcrtpsender that some amount of encoded video data for one or more frames has been lost, using picture loss indication (pli) packets.
... qpsum a 64-bit value containing the sum of the qp values for every frame encoded by this rtcrtpsender.
...And 2 more matches
SubtleCrypto.encrypt() - Web APIs
function getmessageencoding() { const messagebox = document.queryselector(".rsa-oaep #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } function encryptmessage(publickey) { let encoded = getmessageencoding(); return window.crypto.subtle.encrypt( { name: "rsa-oaep" }, publickey, encoded ); } aes-ctr this code fetches the contents of a text box, encodes it for encryption, and encrypts it using aes in ctr mode.
... function getmessageencoding() { const messagebox = document.queryselector(".aes-ctr #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } function encryptmessage(key) { let encoded = getmessageencoding(); // counter will be needed for decryption counter = window.crypto.getrandomvalues(new uint8array(16)); return window.crypto.subtle.encrypt( { name: "aes-ctr", counter, length: 64 }, key, encoded ); } let iv = new uint8array(16); let key = new uint8array(16); let data = new uint8array(12345); //crypto functions are wrapped in promises so we have to use await and make sure the function that //contains this code is an async function //encrypt function wants a cry...
...ptokey object const key_encoded = await crypto.subtle.importkey( "raw", key.buffer, 'aes-ctr' , false, ["encrypt", "decrypt"]); const encrypted_content = await window.crypto.subtle.encrypt( { name: "aes-ctr", counter: iv, length: 128 }, key_encoded, data ); //uint8array console.log(encrypted_content); aes-cbc this code fetches the contents of a text box, encodes it for encryption, and encrypts it using aes in cbc mode.
...And 2 more matches
Writing WebSocket servers - Web APIs
| +---------------------------------------------------------------+ the mask bit tells whether the message is encoded.
... the opcode field defines how to interpret the payload data: 0x0 for continuation, 0x1 for text (which is always encoded in utf-8), 0x2 for binary, and other so-called "control codes" that will be discussed later.
...let's call the data encoded, and the key mask.
...And 2 more matches
WindowOrWorkerGlobalScope.atob() - Web APIs
the windoworworkerglobalscope.atob() function decodes a string of data which has been encoded using base64 encoding.
... syntax var decodeddata = scope.atob(encodeddata); parameters encodeddata a binary string contains an base64 encoded data.
... return value an ascii string containing decoded data from encodeddata.
...And 2 more matches
WindowOrWorkerGlobalScope.btoa() - Web APIs
the windoworworkerglobalscope.btoa() method creates a base64-encoded ascii string from a binary string (i.e., a string object in which each character in the string is treated as a byte of binary data).
... syntax var encodeddata = scope.btoa(stringtoencode); parameters stringtoencode the binary string to encode.
... example const encodeddata = window.btoa('hello, world'); // encode a string const decodeddata = window.atob(encodeddata); // decode the string unicode strings the btoa() function takes a javascript string as a parameter.
...And 2 more matches
HTTP authentication - HTTP
here, the <type> is needed again followed by the credentials, which can be encoded or encrypted depending on which authentication scheme is used.
...common authentication schemes include: basic see rfc 7617, base64-encoded credentials.
... digest see rfc 7616, only md5 hashing is supported in firefox, see bug 472823 for sha encryption support hoba see rfc 7486, section 3, http origin-bound authentication, digital-signature-based mutual see rfc 8120 aws4-hmac-sha256 see aws docs basic authentication scheme the "basic" http authentication scheme is defined in rfc 7617, which transmits credentials as user id/password pairs, encoded using base64.
...And 2 more matches
base64 - Archive of obsolete content
var base64 = require("sdk/base64"); var encodeddata = base64.encode("hello, world"); var decodeddata = base64.decode(encodeddata); globals functions encode(data, charset) creates a base-64 encoded ascii string from a string of binary data.
...in order to encode and decode unicode strings, the charset parameter needs to be set: var base64 = require("sdk/base64"); var encodeddata = base64.encode(unicodestring, "utf-8"); returns string : the encoded string decode(data, charset) decodes a string of data which has been encoded using base-64 encoding.
... parameters data : string the encoded data charset : string the charset of the string to encode (optional).
...in order to encode and decode unicode strings, the charset parameter needs to be set: var base64 = require("sdk/base64"); var decodeddata = base64.decode(encodeddata, "utf-8"); returns string : the decoded string ...
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
text file input listing 15 shows an example of opening a text file encoded as shift-jis (a double-byte character encoding for japanese).
...ement_character); var out = {}; converterstream.readstring(filestream.available(), out); var filecontents = out.value; converterstream.close(); filestream.close(); alert(filecontents); outputting text files fixme: not sure this example is relevant in an english context, maybe something from the snippets listing 16 shows how to take text internally represented as unicode and output it to a file encoded using euc-jp (a japanese text encoding).
... listing 16: writing text to a file encoded as euc-jp var string = '\u5909\u63db\u30c6\u30b9\u30c8'; file.initwithpath('c:\\temp\\temp.txt'); file.create(file.normal_file_type, 0666); var charset = 'euc-jp'; var filestream = components .classes['@mozilla.org/network/file-output-stream;1'] .createinstance(components.interfaces.nsifileoutputstream); filestream.init(file, 2, 0x200, false); var converterstream = components .classes['@mozilla.org/intl/converter-output-stream;1'] .createinstance(components.interface...
...i('http://www.gihyo.co.jp/magazines/sd', referrer); listing 22: loading a page with data transmitted via the post method var content = encodeuricomponent('password=foobar'); var referrer = null; var postdata = components.classes['@mozilla.org/io/string-input-stream;1'] .createinstance(components.interfaces.nsistringinputstream); content = 'content-type: application/x-www-form-urlencoded\n'+ 'content-length: '+content.length+'\n\n'+ content; postdata.setdata(content, content.length); var flags = components.interfaces.nsiwebnavigation.load_flags_none; browser.loaduriwithflags('http://piro.sakura.ne.jp/', flags, referrer, null, postdata); « previousnext » ...
Why RSS Content Module is Popular - Including HTML Contents - Archive of obsolete content
the rss 2.0 specification clearly states that “entity-encoded html is allowed“ and even provides examples showing exactly the syntax above (using cdata and unencoded html).
...sun, 15 may 2005 13:02:08 -0500</lastbuilddate> <link>http://www.example.com</link> <item> <title>a link in here</title> <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/114</guid> <pubdate>sun, 15 may 2005 13:02:08 -0500</pubdate> <link>http://www.example.com/blog/2005/05/15/114</link> <content:encoded><![cdata[this is a <a href="http://example.com/">link</a>.]]></content:encoded> </item> <item> <title>some italics html</title> <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/113</guid> <pubdate>sun, 15 may 2005 10:55:12 -0500</pubdate> <link>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/113</link> ...
... <content:encoded><![cdata[this is <i>italics</i>.]]></content:encoded> </item> <item> <title>some bold html</title> <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/112</guid> <pubdate>sun, 15 may 2005 08:14:11 -0500</pubdate> <link>http://www.example.com/blog/2005/05/15/112</link> <content:encoded><![cdata[this is <b>bold</b>.]]></content:encoded> </item> </channel> </rss> the <content:encoded> element is the reason that the rss content module is popular.
... note: strictly speaking, the rss content module and <content:encoded> are not quite being used correctly.
CERT_FindCertByDERCert
find a certificate in the database that matches a der-encoded certificate.
... syntax #include <cert.h> certcertificate *cert_findcertbydercert( certcertdbhandle *handle, secitem *dercert ); parameters handle in pointer to a certcertdbhandle representing the certificate database to look in dercert in pointer to an secitem whose type must be sidercertbuffer and whose data contains a der-encoded certificate description this function looks in the ?nsscryptocontext?
...to find the certificate that matches the der-encoded certificate.
... a match is found when the issuer and serial number of the der-encoded certificate are found on a certificate in the certificate database.
JSS Provider Notes
rsa the following transformations are supported for generatepublic() and generateprivate(): from to rsapublickeyspec rsapublickey dsapublickeyspec dsapublickey x509encodedkeyspec rsapublickey dsapublickey rsaprivatecrtkeyspec rsaprivatekey dsaprivatekeyspec dsaprivatekey pkcs8encodedkeyspec rsaprivatekey dsaprivatekey ...
... translatekey() simply gets the encoded form of the given key and then tries to import it by calling generatepublic() or generateprivate().
... only x509encodedkeyspec is supported for public keys, and only pkcs8encodedkeyspec is supported for private keys.
...if that fails, it calls getencoded() on the source key, and then tries to create a new key on the target token from the encoded bits.
Mozilla-JSS JCA Provider notes
keyfactory supported algorithms notes dsa rsa the following transformations are supported for generatepublic() and generateprivate(): from to rsapublickeyspec rsapublickey dsapublickeyspec dsapublickey x509encodedkeyspec rsapublickey dsapublickey rsaprivatecrtkeyspec rsaprivatekey dsaprivatekeyspec dsaprivatekey pkcs8encodedkeyspec rsaprivatekey dsaprivatekey getkeyspec() is not supported.
... translatekey() simply gets the encoded form of the given key and then tries to import it by calling generatepublic() or generateprivate().
... only x509encodedkeyspec is supported for public keys, and only pkcs8encodedkeyspec is supported for private keys.
...if that fails, it calls getencoded() on the source key, and then tries to create a new key on the target token from the encoded bits.
nss tech note3
the oid for this extension is { 2 5 29 19 }, encoded in hex as 0x55, 0x1d, 0x13.
...the oid for this extension is { 2 16 840 1 113730 1 1 } encoded in hex as 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x01 in addition to netscape's own cert type extension, nss recognizes various x.509 extensions.
... the x.509 key usage extension has oid { 2 5 29 0f } encoded in hex as 0x55, 0x1d, 0x0f.
... the x.509v3 extended key usage extension as oid { 2 5 29 37 } encoded in hex as 0x55, 0x1d, 0x25.
nsIAccessibleText
getselectionbounds() void getselectionbounds( in long selectionnum, out long startoffset, out long endoffset ); parameters selectionnum startoffset endoffset gettext() string methods may need to return multibyte-encoded strings, since some locales can not be encoded using 16-bit chars.
...astring gettext( in long startoffset, in long endoffset ); parameters startoffset endoffset return value gettextafteroffset() string methods may need to return multibyte-encoded strings, since some locales can't be encoded using 16-bit chars.
...astring gettextafteroffset( in long offset, in nsaccessibletextboundary boundarytype, out long startoffset, out long endoffset ); parameters offset boundarytype startoffset endoffset return value gettextatoffset() string methods may need to return multibyte-encoded strings, since some locales can't be encoded using 16-bit chars.
... return value exceptions thrown missing exception gettextbeforeoffset() string methods may need to return multibyte-encoded strings, since some locales can't be encoded using 16-bit chars.
nsIUTF8ConverterService
inherits from: nsisupports last changed in gecko 1.7 method overview autf8string convertstringtoutf8(in acstring astring, in string acharset, in boolean askipcheck); autf8string converturispectoutf8(in acstring aspec, in string acharset); methods convertstringtoutf8() ensure that astring is encoded in utf-8.
... if not, convert to utf-8 assuming it's encoded in acharset and return the converted string in utf-8.
...converturispectoutf8() ensure that aspec (after url-unescaping it) is encoded in utf-8.
... if not, convert it to utf-8, assuming it's encoded in acharset, and return the result.
Using the Resource Timing API - Web APIs
the encodedbodysize property returns the size (in octets) received from the fetch (http or cache), of the payload body, before removing any applied content-codings.
...decodedbodysize[" + i + "] = not supported"); if ("encodedbodysize" in list[i]) console.log("...
... encodedbodysize[" + i + "] = " + list[i].encodedbodysize); else console.log("...
... encodedbodysize[" + i + "] = not supported"); if ("transfersize" in list[i]) console.log("...
SubtleCrypto.sign() - Web APIs
WebAPISubtleCryptosign
*/ function getmessageencoding() { const messagebox = document.queryselector(".rsassa-pkcs1 #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } let encoded = getmessageencoding(); let signature = await window.crypto.subtle.sign( "rsassa-pkcs1-v1_5", privatekey, encoded ); rsa-pss this code fetches the contents of a text box, encodes it for signing, and signs it with a private key.
...*/ function getmessageencoding() { const messagebox = document.queryselector(".rsa-pss #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } let encoded = getmessageencoding(); let signature = await window.crypto.subtle.sign( { name: "rsa-pss", saltlength: 32, }, privatekey, encoded ); ecdsa this code fetches the contents of a text box, encodes it for signing, and signs it with a private key.
...*/ function getmessageencoding() { const messagebox = document.queryselector(".ecdsa #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } let encoded = getmessageencoding(); let signature = await window.crypto.subtle.sign( { name: "ecdsa", hash: {name: "sha-384"}, }, privatekey, encoded ); hmac this code fetches the contents of a text box, encodes it for signing, and signs it with a secret key.
...*/ function getmessageencoding() { const messagebox = document.queryselector(".hmac #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } let encoded = getmessageencoding(); let signature = await window.crypto.subtle.sign( "hmac", key, encoded ); specifications specification status comment web cryptography apithe definition of 'subtlecrypto.sign()' in that specification.
Writing a WebSocket server in C# - Web APIs
utehash( encoding.utf8.getbytes( new system.text.regularexpressions.regex("sec-websocket-key: (.*)").match(data).groups[1].value.trim() + "258eafa5-e914-47da-95ca-c5ab0dc85b11" ) ) ) + eol + eol); stream.write(response, 0, response.length); } decoding messages after a successful handshake, the client will send encoded messages to the server.
... the remaining bytes are the encoded message payload.
... decoding algorithm di = ei xor m(i mod 4) where d is the decoded message array, e is the encoded message array, m is the mask byte array, and i is the index of the message byte to decode.
... example in c#: byte[] decoded = new byte[3]; byte[] encoded = new byte[3] {112, 16, 109}; byte[] mask = new byte[4] {61, 84, 35, 6}; for (int i = 0; i < encoded.length; i++) { decoded[i] = (byte)(encoded[i] ^ mask[i % 4]); } put together wsserver.cs // // csc wsserver.cs // wsserver.exe using system; using system.net; using system.net.sockets; using system.text; using system.text.regularexpressions; class server { public static void main() { string ip = "127.0.0.1"; int port = 80; var server = new tcplistener(ipaddress.parse(ip), port); server.start(); console.writeline("server has started on {0}:{1}, waiting for a connection...", ip, port); tcpclient client = server.accepttcpclient(); console.writeline("a client connected...
Setting up adaptive streaming media sources - Developer guides
the good news is that once we have encoded our media in the appropriate format we are pretty good to go.
... once encoded your file structure may look something like this: play list -> /segments/news.mp4.mpd main segment folder -> /segments/main/ 100 kbps segment folder -> /segments/main/news100 contains (1.m4s, 2.m4s, 3.m4s ...
... media is usually encoded as mpeg-4 (h.264 video and aac audio) and packaged into an mpeg-2 transport stream, which is then broken into segments and saved as one or more .ts media files.
... apple also provides a file segmenter for mac — which takes a suitably encoded file, splits it up and produces a index file, in a similar fashion to the stream segmenter.
<keygen> - HTML: Hypertext Markup Language
WebHTMLElementkeygen
the value of the pqg parameter is the the base64 encoded, der encoded dss-parms as specified in ietf rfc 3279.
... publickeyandchallenge ::= sequence { spki subjectpublickeyinfo, challenge ia5string } signedpublickeyandchallenge ::= sequence { publickeyandchallenge publickeyandchallenge, signaturealgorithm algorithmidentifier, signature bit string } the public key and challenge string are der encoded as publickeyandchallenge, and then digitally signed with the private key to produce a signedpublickeyandchallenge.
... the signedpublickeyandchallenge is base64 encoded, and the ascii data is finally submitted to the server as the value of a form name/value pair, where the name is name as specified by the name attribute of the keygen element.
... if no challenge string is provided, then it will be encoded as an ia5string of length zero.
HTTP Public Key Pinning (HPKP) - HTTP
enabling hpkp to enable this feature for your site, you need to return the public-key-pins http header when your site is accessed over https: public-key-pins: pin-sha256="base64=="; max-age=expiretime [; includesubdomains][; report-uri="reporturi"] pin-sha256 the quoted string is the base64 encoded subject public key information (spki) fingerprint.
... extracting the base64 encoded public key information note: while the example below shows how to set a pin on a server certificate, it is recommended to place the pin on the intermediate certificate of the ca that issued the server certificate, to ease certificates renewals and rotations.
... the following commands will help you extract the base64 encoded information from a key file, a certificate signing request, or a certificate.
...form der -pubout | openssl dgst -sha256 -binary | openssl enc -base64 openssl req -in my-signing-request.csr -pubkey -noout | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64 openssl x509 -in my-certificate.crt -pubkey -noout | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64 the following command will extract the base64 encoded information for a website.
decodeURI() - JavaScript
syntax decodeuri(encodeduri) parameters encodeduri a complete, encoded uniform resource identifier.
... return value a new string representing the unencoded version of the given encoded uniform resource identifier (uri).
... exceptions throws an urierror ("malformed uri sequence") exception when encodeduri contains invalid character sequences.
... description replaces each escape sequence in the encoded uri with the character that it represents, but does not decode escape sequences that could not have been introduced by encodeuri.
encodeURIComponent() - JavaScript
return value a new string representing the provided string encoded as a uri component.
... follows: var set1 = ";,/?:@&=+$"; // reserved characters var set2 = "-_.!~*'()"; // unescaped characters var set3 = "#"; // number sign var set4 = "abc abc 123"; // alphanumeric characters + space console.log(encodeuri(set1)); // ;,/?:@&=+$ console.log(encodeuri(set2)); // -_.!~*'() console.log(encodeuri(set3)); // # console.log(encodeuri(set4)); // abc%20abc%20123 (the space gets encoded as %20) console.log(encodeuricomponent(set1)); // %3b%2c%2f%3f%3a%40%26%3d%2b%24 console.log(encodeuricomponent(set2)); // -_.!~*'() console.log(encodeuricomponent(set3)); // %23 console.log(encodeuricomponent(set4)); // abc%20abc%20123 (the space gets encoded as %20) note that a urierror will be thrown if one attempts to encode a surrogate which is not part of a high-low pair, e.g., // high...
... for example, if a user writes "jack & jill", the text may get encoded as "jack &amp; jill".
... for application/x-www-form-urlencoded, spaces are to be replaced by "+", so one may wish to follow a encodeuricomponent() replacement with an additional replacement of "%20" with "+".
The "codecs" parameter in common media types - Web media technologies
as is the case with any mime type parameter, codecs must be changed to codecs* (note the asterisk character, *) if any of the properties of the codec use special characters which must be percent-encoded per rfc 2231, section 4: mime parameter value and encoded word extensions.
... you can use the javascript encodeuri() function to encode the parameter list; similarly, you can use decodeuri() to decode a previously encoded parameter list.
... thus, the syntaxes for each of the supported codecs look like this: cccc[.pp]* (generic iso bmff) where cccc is the four-character id for the codec and pp is where zero or more two-character encoded property values go.
... webm media type examples video/webm;codecs="vp08.00.41.08,vorbis" vp8 video, profile 0 level 4.1, using 8-bit yuv with 4:2:0 chroma subsampling, using bt.709 color primaries, transfer function, and matrix coefficients, with the luminance and chroma values encoded within the legal ("studio") range.
request - Archive of obsolete content
if content is a string, it should be url-encoded (use encodeuricomponent).
...the default value is application/x-www-form-urlencoded.
... for example, if you're retrieving text content which was encoded as iso-8859-1 (latin 1), it will be given a content type of "utf-8" and certain characters will not display correctly.
application/http-index-format specification - Archive of obsolete content
white space and 8 bit characters must be url encoded.
... last-modified rfc 1123 date format url encoded.
...whitespace and 8-bit characters must be url-encoded.
Introduction to Public-Key Cryptography - Archive of obsolete content
three examples of binary formats are der-encoded certificates, pkcs #7 certificate chains, and netscape certificate sequence.
...this data should be base-64 encoded, as described by rfc 1113.
...0:43:34:d1:63:1f:06:7d:c3:40:a8:2a:82:c1:a4:83:2a:fb:2e:8f:fb: f0:6d:ff:75:a3:78:f7:52:47:46:62:97:1d:d9:c6:11:0a:02:a2:e0:cc: 2a:75:6c:8b:b6:9b:87:00:7d:7c:84:76:79:ba:f8:b4:d2:62:58:c3:c5: b6:c1:43:ac:63:44:42:fd:af:c8:0f:2f:38:85:6d:d6:59:e8:41:42:a5: 4a:e5:26:38:ff:32:78:a1:38:f1:ed:dc:0d:31:d1:b0:6d:67:e9:46:a8: d:c4 here is the same certificate displayed in the 64-byte-encoded form interpreted by software: -----begin certificate----- miickzccazsgawibagibazanbgkqhkig9w0baqqfada3mqswcqydvqqgewjvuzer ma8ga1uechmitmv0c2nhcguxftatbgnvbastdfn1chjpewencybdqtaefw05nzew mtgwmtm2mjvafw05otewmtgwmtm2mjvamegxczajbgnvbaytalvtmrewdwydvqqk ewhozxrzy2fwztenmasga1uecxmeuhviczexmbuga1ueaxmou3vwcml5ysbtagv0 dhkwgz8wdqyjkozihvcnaqefbqadgy0amigjaogbamr6ezipgfjx3urjgejmkiqg 7sdatya...
Sending form data - Learn web development
who do you want to say it to?</label> <input name="to" id="to" value="mom"> </div> <div> <button>send my greetings</button> </div> </form> when the form is submitted using the post method, you get no data appended to the url, and the http request looks like so, with the data included in the request body instead: post / http/2.0 host: foo.com content-type: application/x-www-form-urlencoded content-length: 13 say=hi&to=mom the content-length header indicates the size of the body, and the content-type header indicates the type of resource sent to the server.
...by default, its value is application/x-www-form-urlencoded.
... in human terms, this means: "this is form data that has been encoded into url parameters." if you want to send files, you need to take three extra steps: set the method attribute to post because file content can't be put inside url parameters.
Function_Name
syntax #include <headers.h> returntype function_name( paramtype paramname, paramtype paramname, ); parameters paramname sample: in pointer to a certcertdbhandle representing the certificate database to look in paramname sample: in pointer to an secitem whose type must be sidercertbuffer and whose data contains a der-encoded certificate description long description of this function, what it does, and why you would use it.
...avoid describing the return until the next section, for example: this function looks in the nsscryptocontext and the nsstrustdomain to find the certificate that matches the der-encoded certificate.
... a match is found when the issuer and serial number of the der-encoded certificate are found on a certificate in the certificate database.
NSS Sample Code sample5
the public key & private key to use are * sourced from a base64-encoded der subjectpublickeyinfo structure, * and a base64-encoded der privatekeyinfo structure.
... */ #include "nss.h" #include "pk11pub.h" #define base64_encoded_subjectpublickeyinfo "mfwwdqyjkozihvcnaqebbqadswawsajbal3f6tic3jeysugo+a2fpu3w+epv/feix21dc86wynpftw4srftz2onuzyluzdhzdb+k//8dct3iaozuui3r2emcaweaaq==" #define base64_encoded_privatekeyinfo "miibvqibadanbgkqhkig9w0baqefaascat8wgge7ageaakeavcxpmhzckriy6cj5rz89tdb4sm/8v4hfbumlzpziekw1biysw3pag1tpittmmdl1v6t//x1xpcga7nrsldhz4widaqabakeajh8+4qncwcmgivnm6ytbpqt+k/jeoexg2bqhjojvnxn3fazgcefxvpuibcjvfaijs9ybcmozzrato0+k2hwnoqihaoc4nvbo8fqhzs4yxm1m86kml47fa9ui//oufbhladw1aiea2dbmixnsbokb+ohver69p0gnewlvcjc9bjdvfdlvslcciqcptv3vgy...
...forruksm66isg0iti04g9v/w+wmx91wjeeb+qbz" int main(int argc, char **argv) { secstatus rv; certcertificate *cert = null; seckeypublickey *pubkey = null; certsubjectpublickeyinfo *spki = null; seckeyprivatekey *pvtkey = null; int modulus_len, i, outlen; char *buf1 = null; char *buf2 = null; char *pubkstr = base64_encoded_subjectpublickeyinfo; char *pvtkstr = base64_encoded_privatekeyinfo; secitem der; secitem nickname; pk11slotinfo *slot = null; /* initialize nss * you need to explicitly authenticate to the internal token if you use * nss_init insteadf of nss_nodb_init * invoke this after getting the internal token handle * pk11_authenticate(slot...
NSS_3.12.3_release_notes.html
nss_use_decoded_cka_ec_point boolean (any non-empty value to enable) tells nss to send ec key points across the pkcs#11 interface in the non-standard unencoded format that was used by default before nss 3.12.3.
... the new key point format is a der encoded asn.1 octet string.
...8994: allow softoken's fork check to be disabled bug 479029: ocsp response signature cert found invalid if issuer is trusted only for ssl bug 479601: wrong type (utf8 string) for email addresses in subject by cert_asciitoname bug 480142: use sizeof on the correct type of ckc_x509 in lib/ckfw bug 480257: ocsp fails when response > 1k byte bug 480280: the cka_ec_point pkcs#11 attribute is encoded in the wrong way: missing encapsulating octet string bug 480442: remove (empty) watcomfx.h from nss bug 481216: fix specific spelling errors in nss bug 482702: ocsp test with revoked ca cert validated as good.
nsICryptoHash
acstring finish( in prbool aascii ); parameters aascii if true then the returned value is a base-64 encoded string.
...this can be either binary data or a base-64 encoded string.
...passing true returns the hash as a base 64 encoded string.
Using Fetch - Web APIs
mode: 'cors', // no-cors, *cors, same-origin cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached credentials: 'same-origin', // include, *same-origin, omit headers: { 'content-type': 'application/json' // 'content-type': 'application/x-www-form-urlencoded', }, redirect: 'follow', // manual, *follow, error referrerpolicy: 'no-referrer', // no-referrer, *no-referrer-when-downgrade, origin, origin-when-cross-origin, same-origin, strict-origin, strict-origin-when-cross-origin, unsafe-url body: json.stringify(data) // body data type must match "content-type" header }); return response.json(); // parses json response into native java...
...script objects } postdata('https://example.com/answer', { answer: 42 }) .then(data => { console.log(data); // json data parsed by `data.json()` call }); note that mode: "no-cors" only allows a limited set of headers in the request: accept accept-language content-language content-type with a value of application/x-www-form-urlencoded, multipart/form-data, or text/plain sending a request with credentials included to cause browsers to send a request with credentials included, even for a cross-origin call, add credentials: 'include' to the init object you pass to the fetch() method.
... fetch('https://example.com', { credentials: 'omit' }) uploading json data use fetch() to post json-encoded data.
FileReader.readAsDataURL() - Web APIs
at that time, the result attribute contains the data as a data: url representing the file's data as a base64 encoded string.
... note: the blob's result cannot be directly decoded as base64 without first removing the data-url declaration preceding the base64-encoded data.
... to retrieve only the base64 encoded string, first remove data:*/*;base64, from the result.
RTCRtpStreamStats - Web APIs
plicount the number of times the receiving end of the stream sent a picture loss indiciation (pli) packet to the sender, indicating that it has lost some amount of encoded video data for one or more frames.
...combined with rtcreceivedrtpstreamstats.framesdecoded or rtcsentrtpstreamstats.framesencoded, you can approximate the average qp over those frames, keeping in mind that codecs often vary the quantizer values even within frames.
... slicount the number of times the receiver notified the sender that one or more consecutive (in scan order) encoded video macroblocks have been lost or corrupted; this notification is sent by the receiver to the sender using a slice loss indication (sli) packet.
URLUtilsReadOnly.hash - Web APIs
the hash is not percent encoded.
...sung internethash experimentalchrome no support noedge no support nofirefox full support 38 full support 38 no support 3.5 — 38notes notes before firefox 38, firefox returned the hash percent encoded.
... nowebview android no support nochrome android no support nofirefox android full support 38 full support 38 no support 4 — 38notes notes before firefox 38, firefox returned the hash percent encoded.
Writing a WebSocket server in Java - Web APIs
cket\r\n" + "sec-websocket-accept: " + base64.getencoder().encodetostring(messagedigest.getinstance("sha-1").digest((match.group(1) + "258eafa5-e914-47da-95ca-c5ab0dc85b11").getbytes("utf-8"))) + "\r\n\r\n").getbytes("utf-8"); out.write(response, 0, response.length); decoding messages after a successful handshake, client can send messages to the server, but now these are encoded.
... - the remaining encoded bytes are the message.
... decoding algorithm decoded byte = encoded byte xor (position of encoded byte bitwise and 0x3)th byte of key example in java: byte[] decoded = new byte[6]; byte[] encoded = new byte[] { (byte) 198, (byte) 131, (byte) 130, (byte) 182, (byte) 194, (byte) 135 }; byte[] key = new byte[] { (byte) 167, (byte) 225, (byte) 225, (byte) 210 }; for (int i = 0; i < encoded.length; i++) { decoded[i] = (byte) (encoded[i] ^ key[i & 0x3]); } } } finally { s.close(); } } finally { server.close(); } } } related writing websocket servers ...
<input type="image"> - HTML: Hypertext Markup Language
WebHTMLElementinputimage
there are three permitted values: application/x-www-form-urlencoded this, the default value, sends the form data as a string after url encoding the text using an algorithm such as encodeuri().
...permitted values are: get a url is constructed by starting with the url given by the formaction or action attribute, appending a question mark ("?") character, then appending the form's data, encoded as described by formenctype or the form's enctype attribute.
...possible values are: application/x-www-form-urlencoded: the default value if the attribute is not specified.
<input type="submit"> - HTML: Hypertext Markup Language
WebHTMLElementinputsubmit
there are three permitted values: application/x-www-form-urlencoded this, the default value, sends the form data as a string after url encoding the text using an algorithm such as encodeuri().
...permitted values are: get a url is constructed by starting with the url given by the formaction or action attribute, appending a question mark ("?") character, then appending the form's data, encoded as described by formenctype or the form's enctype attribute.
...in this instance, the string will be text=usertext, where "usertext" is the text entered by the user, encoded to preserve special characters.
Data URLs - HTTP
otherwise, you can specify base64 to embed base64-encoded binary data.
... data:text/plain;base64,sgvsbg8sifdvcmxkiq== base64-encoded version of the above data:text/html,%3ch1%3ehello%2c%20world!%3c%2fh1%3e an html document with <h1>hello, world!</h1> data:text/html,<script>alert('hi');</script> an html document that executes a javascript alert.
...for example, the opera 11 browser limited urls to 65535 characters long which limits data urls to 65529 characters (65529 characters being the length of the encoded data, not the source, if you use the plain data:, without specifying a mime type).
POST - HTTP
WebHTTPMethodsPOST
in this case, the content type is selected by putting the adequate string in the enctype attribute of the <form> element or the formenctype attribute of the <input> or <button> elements: application/x-www-form-urlencoded: the keys and values are encoded in key-value tuples separated by '&', with a '=' between the key and the value.
... non-alphanumeric characters in both keys and values are percent encoded: this is the reason why this type is not suitable to use with binary data (use multipart/form-data instead) multipart/form-data: each value is sent as a block of data ("body part"), with a user agent-defined delimiter ("boundary") separating each part.
... request has body yes successful response has body yes safe no idempotent no cacheable only if freshness information is included allowed in html forms yes syntax post /test example a simple form using the default application/x-www-form-urlencoded content type: post /test http/1.1 host: foo.example content-type: application/x-www-form-urlencoded content-length: 27 field1=value1&field2=value2 a form using the multipart/form-data content type: post /test http/1.1 host: foo.example content-type: multipart/form-data;boundary="boundary" --boundary content-disposition: form-data; name="field1" value1 --boundary content-disposition: form-da...
decodeURIComponent() - JavaScript
syntax decodeuricomponent(encodeduri) parameters encodeduri an encoded component of a uniform resource identifier.
... return value a new string representing the decoded version of the given encoded uniform resource identifier (uri) component.
... description replaces each escape sequence in the encoded uri component with the character that it represents.
encodeURI() - JavaScript
return value a new string representing the provided string encoded as a uri.
...codeuri vs encodeuricomponent encodeuri() differs from encodeuricomponent() as follows: var set1 = ";,/?:@&=+$#"; // reserved characters var set2 = "-_.!~*'()"; // unreserved marks var set3 = "abc abc 123"; // alphanumeric characters + space console.log(encodeuri(set1)); // ;,/?:@&=+$# console.log(encodeuri(set2)); // -_.!~*'() console.log(encodeuri(set3)); // abc%20abc%20123 (the space gets encoded as %20) console.log(encodeuricomponent(set1)); // %3b%2c%2f%3f%3a%40%26%3d%2b%24%23 console.log(encodeuricomponent(set2)); // -_.!~*'() console.log(encodeuricomponent(set3)); // abc%20abc%20123 (the space gets encoded as %20) note that encodeuri() by itself cannot form proper http get and post requests, such as for xmlhttprequest, because "&", "+", and "=" are not encoded, which are treated as...
... // high-low pair ok console.log(encodeuri('\ud800\udfff')); // lone high surrogate throws "urierror: malformed uri sequence" console.log(encodeuri('\ud800')); // lone low surrogate throws "urierror: malformed uri sequence" console.log(encodeuri('\udfff')); encoding for ipv6 if one wishes to follow the more recent rfc3986 for urls, which makes square brackets reserved (for ipv6) and thus not encoded when forming something which could be part of a url (such as a host), the following code snippet may help: function fixedencodeuri(str) { return encodeuri(str).replace(/%5b/g, '[').replace(/%5d/g, ']'); } specifications specification ecmascript (ecma-262)the definition of 'encodeuri' in that specification.
Media container formats (file types) - Web media technologies
instead, it streams the encoded audio and video tracks directly from one peer to another using mediastreamtrack objects to represent each track.
...a good example of this is the mp3 audio file, which is in fact an mpeg-1 container with a single audio track encoded using mpeg-1 audio layer iii encoding.
...you should carefully consider the options before making a final decision, especially if you have a lot of media that will need to be encoded.
Digital video concepts - Web media technologies
since the color data is being encoded at a lower resolution than the luma, when decoding the video to draw it to the screen each pixel's color is computed by calculating an appropriate color given the u and v values for the 4x2 block of 8 pixels in which the pixel resides.
... the first number specifies the number of luminance samples per row encoded from the 4x2 pixel block.
...for example, in the av1 codec, a record stores the encoded luma for a tile, and a second record contains the chroma data in the form of the u and v values.
Subresource Integrity - Web security
using subresource integrity you use the subresource integrity feature by specifying a base64-encoded cryptographic hash of a resource (file) you’re telling the browser to fetch, in the value of the integrity attribute of any <script> or <link> element.
... an integrity value begins with at least one string, with each string including a prefix indicating a particular hash algorithm (currently the allowed prefixes are sha256, sha384, and sha512), followed by a dash, and ending with the actual base64-encoded hash.
... example integrity string with base64-encoded sha384 hash: sha384-oqvuafxrkap7fdgccy5uykm6+r9gqq8k/uxy9rx7hnqlgyl1kpzqho1wx4jwy8wc so oqvuafxrkap7fdgccy5uykm6+r9gqq8k/uxy9rx7hnqlgyl1kpzqho1wx4jwy8wc is the "hash" part, and the prefix sha384 indicates that it's a sha384 hash.
Post data to window - Archive of obsolete content
here is an example: var datastring = "name1=data1&name2=data2"; // post method requests must wrap the encoded text in a mime // stream const cc = components.classes; const ci = components.interfaces; var stringstream = cc["@mozilla.org/io/string-input-stream;1"].
... createinstance(ci.nsimimeinputstream); postdata.addheader("content-type", "application/x-www-form-urlencoded"); postdata.addcontentlength = true; postdata.setdata(stringstream); // postdata is ready to be used as apostdata argument ...
Extension Versioning, Update and Compatibility - Archive of obsolete content
the public part of the key is der encoded and then base 64 encoded and added to the add-on's install.rdf as an updatekey entry.
...the resultant data is der encoded then base 64 encoded for inclusion in the update.rdf as an signature entry.
Locked config settings - Archive of obsolete content
the mozilla.cfg file is an encoded file of javascript commands.
...and to decode mozilla.cfg files: moz-byteshift.pl -s -13 <mozilla.cfg >mozilla.cfg.txt example of an unencoded file: mozilla.cfg.txt.
generateCRMFRequest() - Archive of obsolete content
the value of this argument is a base-64 encoded certificate.
...the string found by accessing crmfobject.request is the base-64 encoded crmf message to be sent to the ca/ra, or an error string.
popChallengeResponse - Archive of obsolete content
resultstring = crypto.popchallengeresponse("challengestring"); argument description "challengestring" a base-64 encoded cmmf popodeckeychallcontent message.
... the resultstring will either be a base-64 encoded popodeckeyrespcontent message, or one of the following error strings: error string description "error:invalidparameter:xxx" the parameter xxx was an invalid value.
jspage - Archive of obsolete content
ic","quart","quint"].each(function(b,a){fx.transitions[b]=new fx.transition(function(c){return math.pow(c,[a+2]); });});var request=new class({implements:[chain,events,options],options:{url:"",data:"",headers:{"x-requested-with":"xmlhttprequest",accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",issuccess:null,emulation:true,urlencoded:true,encoding:"utf-8",evalscripts:false,evalresponse:false,nocache:false},initialize:function(a){this.xhr=new browser.request(); this.setoptions(a);this.options.issuccess=this.options.issuccess||this.issuccess;this.headers=new hash(this.options.headers);},onstatechange:function(){if(this.xhr.readystate!=4||!this.running){return; }this.running=false;this.status=0;$try(function(){this.status=this.x...
...l:d.url,method:d.method},k);var g=k.data,b=string(k.url),a=k.method.tolowercase(); switch($type(g)){case"element":g=document.id(g).toquerystring();break;case"object":case"hash":g=hash.toquerystring(g);}if(this.options.format){var j="format="+this.options.format; g=(g)?j+"&"+g:j;}if(this.options.emulation&&!["get","post"].contains(a)){var h="_method="+a;g=(g)?h+"&"+g:h;a="post";}if(this.options.urlencoded&&a=="post"){var c=(this.options.encoding)?"; charset="+this.options.encoding:""; this.headers.set("content-type","application/x-www-form-urlencoded"+c);}if(this.options.nocache){var f="nocache="+new date().gettime();g=(g)?f+"&"+g:f; }var e=b.lastindexof("/");if(e>-1&&(e=b.indexof("#"))>-1){b=b.substr(0,e);}if(g&&a=="get"){b=b+(b.contains("?")?"&":"?")+g;g=null;}this.xhr.open(a.touppercase(),b,thi...
Implementation Status - Archive of obsolete content
ted 11.8.1 name unsupported 11.8.2 value unsupported 11.9 submission options supported 11.9.1 the get submission method supported 11.9.2 the post, multipart-post, form-data-post, and urlencoded-post submission methods supported 11.9.3 the put submission method supported 11.9.4 the delete submission method unsupported 11.9.5 serialization as application/xml supported 11.9.6 serialization as multipart/related ...
...partial 330557; 11.9.7 serialization as multipart/form-data supported 11.9.8 serialization as application/x-www-form-urlencoded supported 11.10 replacing data with the submission response partial @replace with value of 'text' not supported 11.11 integration with soap supported g.
Percent-encoding - MDN Web Docs Glossary: Definitions of Web-related terms
other characters don't need to be encoded, though they could.
...' '@' '!' '$' '&' "'" '(' ')' '*' '+' ',' ';' '=' '%' ' ' %3a %2f %3f %23 %5b %5d %40 %21 %24 %26 %27 %28 %29 %2a %2b %2c %3b %3d %25 %20 or + depending on the context, the character ' ' is translated to a '+' (like in the percent-encoding version used in an application/x-www-form-urlencoded message), or in '%20' like on urls.
Server-side web frameworks - Learn web development
urlpatterns = [ url(r'^$', views.index), # example: /best/myteamname/5/ url(r'^best/(?p<team_name>\w.+?)/(?p<team_number>[0-9]+)/$', views.best), ] make it easy to access data in the request data can be encoded in an http request in a number of ways.
...django can also pass information encoded in the structure of the url by defining "capture patterns" in the url mapper (see the last code fragment in the section above).
Creating Sandboxed HTTP Connections
in this case, the data is url encoded, meaning that the string should look like this: foo=bar&baz=eek.
...its setuploadstream method is called, passing in the nsiinputstream and the type (in this case, "application/x-www-form-urlencoded"): var uploadchannel = gchannel.queryinterface(components.interfaces.nsiuploadchannel); uploadchannel.setuploadstream(inputstream, "application/x-www-form-urlencoded", -1); due to a bug, calling setuploadstream will reset the nsihttpchannel to be a put request, so now the request type is set to post: // order important - setuploadstream resets to put httpchannel.requestmethod = "post"; ...
OS.File for the main thread
at the time of this writing, write does not support encoding option so the text to be written has to be encoded with textencoder.
... var pth = os.path.join(os.constants.path.desktopdir, 'app.txt'); os.file.open(pth, {write: true, append: true}).then(valopen => { console.log('valopen:', valopen); var txttoappend = 'append some text \n'; var txtencoded = new textencoder().encode(txttoappend); valopen.write(txtencoded).then(valwrite => { console.log('valwrite:', valwrite); valopen.close().then(valclose => { console.log('valclose:', valclose); console.log('successfully appended'); }); }); }); global object os.file method overview promise<file> open(in string path, [optional] in o...
NSS_3.12.1_release_notes.html
new in nss 3.12.1 new functions in the nss shared library: cert_nametoasciiinvertible (see cert.h) convert an certname into its rfc1485 encoded equivalent.
...skeyandmacderive makes conditional code unconditional bug 443760: extra semicolon in seqdatabase makes static analysis tool suspicious bug 448323: certutil -k doesn't report the token and slot names for found keys bug 448324: ocsp checker returns incorrect error code on request with invalid signing cert bug 449146: remove dead libsec function declarations bug 453227: installation of pem-encoded certificate without trailing newline fails documentation for a list of the primary nss documentation pages on mozilla.org, see nss documentation.
NSS 3.55 release notes
with this function, a given slot can be queried with a der-encoded certificate, providing performance and usability improvements over other mechanisms.
... bug 1649633 - add pk11_findcertinslot to search a given slot for a der-encoded certificate.
Python binding for NSS
if a python unicode object is passed to a nss/nspr function it will be encoded as utf-8 first before being passed to nss/nspr.
... a secitem now converts almost all der encoded data to a string when it's str method is invoked, formerly it was limited to only a few objects.
sslerr.html
sec_error_bad_der -8183 security library: improperly formatted der-encoded message.
...objects are still in use." sec_error_extra_input -8052 "der-encoded message contained extra unused data." sec_error_unsupported_elliptic_curve -8051 "unsupported elliptic curve." sec_error_unsupported_ec_point_form -8050 "unsupported elliptic curve point form." sec_error_unrecognized_oid -8049 "unrecognized object identifier." sec_error_ocsp_invalid_signing_cert -8048 "invalid ocsp signing certificate in...
NSS Tools crlutil
if located in file it should be encoded in asn.1 encode format.
... entry (2): serial number: 42 (0x2a) revocation date: wed feb 23 12:08:40 2005 deleting crl from a database this example deletes crl from a database in the specified directory: crlutil -d -n nickname -d certdir importing crl into a database this example imports crl into a database: crlutil -i -i crl-file -d certdir file should has binary format of asn.1 encoded crl data.
JS_EncodeCharacters
dst const char * the pointer to an array of bytes to be filled with encoded characters; or null.
...if utf-8 is turned on, the length of the encoded string may vary.
JS_EncodeStringToBuffer
buffer char * a character buffer to receive encoded string.
...it returns the length of the whole string encoding or (size_t)-1 if the string can't be encoded as bytes.
Shell global objects
savebytecode if true, and if the source is a cacheentryobject, the bytecode would be encoded and saved into the cache entry after the script execution.
... asserteqbytecode if true, and if both loadbytecode and savebytecode are true, then the loaded bytecode and the encoded bytecode are compared.
Index
MozillaTechXPCOMIndex
1039 nsiutf8converterservice ensure that astring is encoded in utf-8.
... if not, convert to utf-8 assuming it's encoded in acharset and return the converted string in utf-8.
nsIAbCard
inherits from: nsisupports method overview astring getcardvalue(in string name) void setcardvalue(in string attrname, in astring value) void copy(in nsiabcard srccard) boolean equals(in nsiabcard card) string converttobase64encodedxml() astring converttoxmlprintdata() string converttoescapedvcard() astring generatename(in long agenerateformat,[optional] in nsistringbundle abundle) astring generatephoneticname(in boolean alastnamefirst) attributes attribute type description firstname astring lastname astring phoneticfirstnam...
... converttobase64encodedxml() string converttobase64encodedxml() return value converttoxmlprintdata() astring converttoxmlprintdata() return value converttoescapedvcard() string converttoescapedvcard() return value generatename() generate a name from the card for display purposes.
nsICryptoHMAC
acstring finish( in prbool aascii ); parameters aascii if true then the returned value is a base-64 encoded string.
...this can be either binary data or base 64 encoded.
nsIDataSignatureVerifier
asignature the signature of the data, base64 encoded.
... apublickey the public part of the key used for signing, der encoded then base64 encoded.
nsILocalFile
note: the value of the followlinks attribute is not encoded in the persistent descriptor.
... remarks the methods initwithnativepath() and appendrelativenativepath() take string valued parameters that are encoded using the native character encoding.
nsIScriptableUnicodeConverter
the bytes in the stream are encoded according to the charset attribute.
...the text is encoded into the character set specified by the charset attribute.
AuthenticatorAttestationResponse.attestationObject - Web APIs
syntax attestobj = authenticatorattestationresponse.attestationobject properties after decoding the cbor encoded arraybuffer, the resulting javascript object will contain the following properties: authdata the same as authenticatorassertionresponse.authenticatordata.
... id : "login.example.com" }, user: { id: new uint8array(16), name: "jdoe@example.com", displayname: "john doe" }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { var attestationobj = newcredentialinfo.response.attestationobject; // this will be a cbor encoded arraybuffer // do something with the response // (sending it back to the relying party server maybe?) }).catch(function (err) { console.error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'attestationobject' in that specification.
AuthenticatorResponse.clientDataJSON - Web APIs
challenge the base64url encoded version of the cryptographic challenge sent from the relying party's server.
...aybuffertostr(buf) { return string.fromcharcode.apply(null, new uint8array(buf)); } // pk is a publickeycredential that is the result of a create() or get() promise var clientdatastr = arraybuffertostr(pk.clientdatajson); var clientdataobj = json.parse(clientdatastr); console.log(clientdataobj.type); // "webauthn.create" or "webauthn.get" console.log(clientdataobj.challenge); // base64 encoded string containing the original challenge console.log(clientdataobj.origin); // the window.origin specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'clientdatajson' in that specification.
Using images - Web APIs
data urls allow you to completely define an image as a base64 encoded string of characters directly in your code.
... some disadvantages of this method are that your image is not cached, and for larger images the encoded url can become quite long.
DedicatedWorkerGlobalScope - Web APIs
for example: importscripts('foo.js', 'bar.js'); implemented from other places windowbase64.atob() decodes a string of data which has been encoded using base-64 encoding.
... windowbase64.btoa() creates a base-64 encoded ascii string from a string of binary data.
HTMLFormElement.enctype - Web APIs
possible values are: application/x-www-form-urlencoded: the initial default type.
... syntax var string = form.enctype; form.enctype = string; example form.enctype = 'application/x-www-form-urlencoded'; specifications specification status comment html living standardthe definition of 'htmlformelement: enctype' in that specification.
Key Values - Web APIs
that key is encoded as "contextmenu".
...although typical numeric keypads have numeric keys from 0 to 9 (encoded as "0" through "9"), some multimedia keyboards include additional number keys for higher numbers.
PublicKeyCredential.id - Web APIs
this property is a base64url encoded version of publickeycredential.rawid.
... syntax id = publickeycredential.id value a domstring being the base64url encoded version of publickeycredential.rawid.
RTCInboundRtpStreamStats.qpSum - Web APIs
you can, for example, use the value of rtcreceivedrtpstreamstats.framesdecoded if receiving the media or rtcsentrtpstreamstats.framesencoded if sending it to get the number of frames handled so far, and compute an average from there.
... function calculateaverageqp(stats) { let framecount = 0; switch(stats.type) { case "inbound-rtp": case "remote-inbound-rtp": framecount = stats.framesdecoded; break; case "outbound-rtp": case "remote-outbound-rtp": framecount = stats.framesencoded; break; default: return 0; } return status.qpsum / framecount; } specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcinboundrtpstreamstats.qpsum' in that specification.
RTCOutboundRtpStreamStats.qpSum - Web APIs
you can use the value of rtcsentrtpstreamstats.framesencoded to get the number of frames that have been encoded so far, and compute an average from there.
... function calculateaverageqp(stats) { let framecount = 0; switch(stats.type) { case "inbound-rtp": case "remote-inbound-rtp": framecount = stats.framesdecoded; break; case "outbound-rtp": case "remote-outbound-rtp": framecount = stats.framesencoded; break; default: return 0; } return status.qpsum / framecount; } specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcoutboundrtpstreamstats.qpsum' in that specification.
RTCRtpSender - Web APIs
the rtcrtpsender interface provides the ability to control and obtain details about how a particular mediastreamtrack is encoded and sent to a remote peer.
... rtcrtpsender.setparameters() applies changes to parameters which configure how the track is encoded and transmitted to the remote peer.
RTCRtpStreamStats.qpSum - Web APIs
you can, for example, use the value of rtcreceivedrtpstreamstats.framesdecoded if receiving the media or rtcsentrtpstreamstats.framesencoded if sending it to get the number of frames handled so far, and compute an average from there.
... function calculateaverageqp(stats) { let framecount = 0; switch(stats.type) { case "inbound-rtp": case "remote-inbound-rtp": framecount = stats.framesdecoded; break; case "outbound-rtp": case "remote-outbound-rtp": framecount = stats.framesencoded; break; default: return 0; } return status.qpsum / framecount; } specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcinboundrtpstreamstats: qpsum' in that specification.
SharedWorkerGlobalScope - Web APIs
for example: importscripts('foo.js', 'bar.js'); implemented from other places windowbase64.atob() decodes a string of data which has been encoded using base-64 encoding.
... windowbase64.btoa() creates a base-64 encoded ascii string from a string of binary data.
Using writable streams - Web APIs
ream we call the sendmessage() function, passing it a message to be written and the stream to write to: sendmessage("hello, world.", writablestream); the sendmessage() definition looks like so: function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter const defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defaultwriter.write(chunk); }) .then(() => { console.log("chunk written to sink."); }) .catch((err) => { console.log("chunk error:", err); }); }); // call ready again to ensure that all chunks are written // be...
... with the chunks encoded, we then call array/foreach on the resulting array.
SubtleCrypto.exportKey() - Web APIs
the exported key is then pem-encoded.
...ity moduluslength: 2048, publicexponent: new uint8array([1, 0, 1]), hash: "sha-256", }, true, ["sign", "verify"] ).then((keypair) => { const exportbutton = document.queryselector(".pkcs8"); exportbutton.addeventlistener("click", () => { exportcryptokey(keypair.privatekey); }); }); subjectpublickeyinfo export this example exports an rsa public encryption key as a pem-encoded subjectpublickeyinfo object.
TextEncoder.prototype.encode() - Web APIs
the textencoder.prototype.encode() method takes a usvstring as input, and returns a uint8array containing the text given in parameters encoded with the specific method for that textencoder object.
... examples <p class="source">this is a sample paragraph.</p> <p class="result">encoded result: </p> const sourcepara = document.queryselector('.source'); const resultpara = document.queryselector('.result'); const string = sourcepara.textcontent; const textencoder = new textencoder(); let encoded = textencoder.encode(string); resultpara.textcontent += encoded; specifications specification status comment encodingthe definition of 'textencoder.prototype.encode()' in that specification.
TextEncoder - Web APIs
textencoder.prototype.encode() takes a usvstring as input, and returns a uint8array containing utf-8 encoded text.
... textencoder.prototype.encodeinto() takes a usvstring to encode and a destination uint8array to put resulting utf-8 encoded text into, and returns a dictionary object indicating the progress of the encoding.
URLUtilsReadOnly - Web APIs
nohash experimentalchrome no support noedge no support nofirefox full support 38 full support 38 no support 3.5 — 38notes notes before firefox 38, firefox returned the hash percent encoded.
... nowebview android no support nochrome android no support nofirefox android full support 38 full support 38 no support 4 — 38notes notes before firefox 38, firefox returned the hash percent encoded.
WEBGL_compressed_texture_etc - Web APIs
the rgb part is encoded the same as rgb_etc2, but the alpha part is encoded separately.
...the srgb part is encoded the same as srgb_etc2, but the alpha part is encoded separately.
WebGL constants - Web APIs
the rgb part is encoded the same as rgb_etc2, but the alpha part is encoded separately.
...the srgb part is encoded the same as srgb_etc2, but the alpha part is encoded separately.
Window - Web APIs
WebAPIWindow
windoworworkerglobalscope.atob() decodes a string of data which has been encoded using base-64 encoding.
... windoworworkerglobalscope.btoa() creates a base-64 encoded ascii string from a string of binary data.
WindowOrWorkerGlobalScope - Web APIs
windoworworkerglobalscope.atob() decodes a string of data which has been encoded using base-64 encoding.
... windoworworkerglobalscope.btoa() creates a base-64 encoded ascii string from a string of binary data.
WorkerGlobalScope - Web APIs
methods implemented from elsewhere windoworworkerglobalscope.atob() decodes a string of data which has been encoded using base-64 encoding.
... windoworworkerglobalscope.btoa() creates a base-64 encoded ascii string from a string of binary data.
Getting Started - Developer guides
for example, use the following before calling send() for form data sent as a query string: httprequest.setrequestheader('content-type', 'application/x-www-form-urlencoded'); step 2 – handling the server response when you sent the request, you provided the name of a javascript function to handle the response: httprequest.onreadystatechange = nameofthefunction; what should this function do?
... httprequest.onreadystatechange = alertcontents; httprequest.open('post', url); httprequest.setrequestheader('content-type', 'application/x-www-form-urlencoded'); httprequest.send('username=' + encodeuricomponent(username)); } the function alertcontents() can be written the same way it was in step 3 to alert our computed string, if that's all the server returns.
Audio and Video Delivery - Developer guides
it's also possible to feed an <audio> element a base64 encoded wav file, allowing to generate audio on the fly: <audio id="player" src="data:audio/x-wav;base64,uklgrvc..."></audio> speak.js employs this technique.
...your files have been encoded incorrectly your files may have been encoded incorrectly — try encoding using one of the following tools, which are proven to be pretty reliable: audacity — free audio editor and recorder miro — free, open-source music and video player handbrake — open source video transcoder firefogg — video and audio encoding for firefox ffmpeg2 — comprehensive command line encoder libav �...
CSP: script-src - HTTP
the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style.
... script-src 'strict-dynamic' 'nonce-somenonce' or script-src 'strict-dynamic' 'sha256-base64encodedhash' it is possible to deploy strict-dynamic in a backwards compatible way, without requiring user-agent sniffing.
HTTP Messages - HTTP
WebHTTPMessages
http messages are composed of textual information encoded in ascii, and span over multiple lines.
... single-resource bodies, consisting of a single file of unknown length, encoded by chunks with transfer-encoding set to chunked.
URIError: malformed URI sequence - JavaScript
message urierror: the uri to be encoded contains invalid character (edge) urierror: malformed uri sequence (firefox) urierror: uri malformed (chrome) error type urierror what went wrong?
...for example: encodeuri('\ud800\udfff'); // "%f0%90%8f%bf" decoding decoding replaces each escape sequence in the encoded uri component with the character that it represents.
String - JavaScript
console.log(eval(s2.valueof())) // returns the number 4 escape notation special characters can be encoded using escape notation: code output \xxx (where xxx is 1–3 octal digits; range of 0–377) iso-8859-1 character / unicode code point between u+0000 and u+00ff \' single quote \" double quote \\ backslash \n new line \r carriage return \v vertical tab \t tab \b backspac...
... string.prototype.codepointat(pos) returns a nonnegative integer number that is the code point value of the utf-16 encoded code point starting at the specified pos.
escape() - JavaScript
syntax escape(str) parameters str a string to be encoded.
...special characters are encoded with the exception of: @*_+-./ the hexadecimal form for characters, whose code unit value is 0xff or less, is a two-digit escape sequence: %xx.
Codecs used by WebRTC - Web media technologies
it's encouraged that video be encoded at a frame rate and size no lower than that, since that's essentially the lower bound of what webrtc generally is expected to handle.
...avc has the advantage, on ios and ipados, of being able to be encoded and decoded in hardware.
port - Archive of obsolete content
this means you can't send functions, and if the object contains methods they won't be encoded.
Communicating using "port" - Archive of obsolete content
this means you can't send functions, and if the object contains methods they won't be encoded.
clipboard - Archive of obsolete content
the following types are supported: text (plain text) html (a string of html) image (a base-64 encoded png) if no data type is provided, then the module will detect it for you.
querystring - Archive of obsolete content
escape(query) the escape function used by stringify to encodes a string safely matching rfc 3986 for application/x-www-form-urlencoded.
url - Archive of obsolete content
if base64 is true, the data property is encoded using base-64 encoding.
cfx - Archive of obsolete content
the object encoded by the json becomes the staticargs property of the system module.
Unit Testing - Archive of obsolete content
to show the module in use, edit the "index.js" file as follows: var base64 = require("./base64"); var button = require("sdk/ui/button/action").actionbutton({ id: "base64", label: "base64", icon: "./icon-16.png", onclick: function() { encoded = base64.btoa("hello"); console.log(encoded); decoded = base64.atob(encoded); console.log(decoded); } }); to run this example you'll also have to have an icon file named "icon-16.png" saved in your add-ons "data" directory.
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
the clock.dtd file inside the fr-fr folder must be encoded as utf-8.
Connecting to Remote Content - Archive of obsolete content
request.open("post", url, true); request.setrequestheader("content-type", "application/x-www-form-urlencoded"); request.send("data=hello&version=2"); the third parameter for the open method specifies whether the request should be handled asynchronously or not.
Using the Stylesheet Service - Archive of obsolete content
'#' must be percent-encoded, details see bug 659650.
Index - Archive of obsolete content
497 popchallengeresponse nss the resultstring will either be a base-64 encoded popodeckeyrespcontent message, or one of the following error strings: 498 jetpack 499 basics writes some information to the error console.
cert_override.txt - Archive of obsolete content
16.840.1.101.3.4.2.3 certificate fingerprint using previous hash algorithm one or more characters for override type: m : allow mismatches in the hostname u : allow untrusted certs (whether it's self signed cert or a missing or invalid issuer cert) t : allow errors in the validity time, for example, for expired or not yet valid certs certificate's serial number and the issuer name as a base64 encoded string ...
Bookmark Keywords - Archive of obsolete content
these searches can be as complex as google will tolerate, since the entered data will be converted to url-encoded text before it's sent to the google servers.
importUserCertificates - Archive of obsolete content
the response is base-64 encoded.
File object - Archive of obsolete content
url is uri-encoded.
URIs and URLs - Archive of obsolete content
an escaped character is encoded as a character triplet, consisting of the percent character "%" followed by the two hexadecimal digits representing the octet code.
Reading from Files - Archive of obsolete content
a binary stream would be used to read bytes or numbers encoded within the file.
Writing to Files - Archive of obsolete content
when writing text files, characters are writing using a chosen character set, encoded automatically.
Property Files - Archive of obsolete content
non-ascii characters, utf-8 and escaping gecko 1.8.x (or later) supports property files encoded in utf-8.
NPN_GetValue - Archive of obsolete content
npnvdocumentorigin: the value for this variable is the unicode serialization of the origin converted to nfkc-encoded (normalized) utf-8.
Browser Detection and Cross Browser Support - Archive of obsolete content
since other browsers pretended to be netscape browsers and encoded their version information in a non-standard fashion in the user agent comment area, the task of determining which browser was being used became more complicated than it should have been.
Plug-in Development Overview - Gecko Plugin API Reference
the returned value is the unicode serialization of the document's origin converted to nfkc-encoded (that is, normalized) utf-8.
CORS-safelisted request header - MDN Web Docs Glossary: Definitions of Web-related terms
for content-type: needs to have a mime type of its parsed value (ignoring parameters) of either application/x-www-form-urlencoded, multipart/form-data, or text/plain.
Latency - MDN Web Docs Glossary: Definitions of Web-related terms
latency can be a factor in any kind of data flow, but is most commonly discussed in terms of network latency (the time it takes for a packet of data to travel from source to destination) and media codec latency (the time it takes for the source data to be encoded or decoded and reach the consumer of the resulting data).
Server - MDN Web Docs Glossary: Definitions of Web-related terms
a client program and server program traditionally connect by passing messages encoded using a protocol over an api.
Character set - MDN Web Docs Glossary: Definitions of Web-related terms
if a character set is used incorrectly (for example, unicode for an acticle encoded in big5), you may see nothing but broken characters, which are called mojibake.
Creating hyperlinks - Learn web development
here's an example that includes a cc, bcc, subject and body: <a href="mailto:nowhere@mozilla.org?cc=name2@rapidtables.com&bcc=name3@rapidtables.com&subject=the%20subject%20of%20the%20email&body=the%20body%20of%20the%20email"> send mail with cc, bcc, subject and body </a> note: the values of each field must be url-encoded, that is with non-printing characters (invisible characters like tabs, carriage returns, and page breaks) and spaces percent-escaped.
Video and audio content - Learn web development
each audio track is encoded using an audio codec, while video tracks are encoded using (as you probably have guessed) a video codec.
Third-party APIs - Learn web development
this type of api is known as a restful api — instead of getting data using the features of a javascript library like we did with mapquest, we get data by making http requests to specific urls, with data like search terms and other properties encoded in the url (often as url parameters).
Introduction to the server side - Learn web development
the request includes a url identifying the affected resource, a method that defines the required action (for example to get, delete, or post the resource), and may include additional information encoded in url parameters (the field-value pairs sent via a query string), as post data (data sent by the http post method), or in associated cookies.
Website security - Learn web development
for example, consider a site search function where the search terms are encoded as url parameters, and these terms are displayed along with the results.
Error codes returned by Mozilla APIs
ns_base_stream_illegal_args (0x80470004) ns_base_stream_no_converter (0x80470005) ns_base_stream_bad_conversion (0x80470006) this error occurs when the component nsistringbundleservice has been set with a badly encoded property file.
Internationalized Domain Names (IDN) Support in Mozilla Browsers
if end users input non-ascii characters as part of a domain name or if a web page contains a link using a non-ascii domain name, the application must convert such input into a special encoded format using only the usual ascii subset characters.
Download
note: this property's value may not match the actual final size of the downloaded file if the download is encoded during the network transfer.
DownloadTarget
for single-file downloads, this property's value will always match the actual size of the file on disk, while the download.totalbytes property, when available, may indicate the size of the data as encoded for transfer instead.
Http.jsm
the elements of the array will be url-encoded and "application/x-www-form-urlencoded; charset=utf-8" will be enforced as the content type.
Encodings for localization files
in general, files in the mozilla repositories are utf-8 encoded.
QA phase
pushing to your repository there are a couple of things you should take note of before you push to your repository: make sure that your files have been encoded in unicode without bom (byte order mark).
Localization sign-off reviews
encoding some tools add bom to utf-8 encoded files, and some change the encoding altogether.
Mozilla Web Developer FAQ
characters in html 4 and xml documents are unicode characters (even if the document has been encoded using a legacy encoding for transfer)—not font glyph indexes.
An overview of NSS Internals
data described as pem is a base64 encoded presentation of der, usually wrapped between human readable begin/end lines.
JSS FAQ
MozillaProjectsNSSJSSJSS FAQ
import java.io.bytearrayinputstream; [...] certificate cert = (certificate) asn1util.decode( certificate.gettemplate(),x509cert.getencoded() ); how do i convert org.mozilla.jss.pkix.cert to org.mozilla.jss.crypto.x509certificate?
NSS 3.12.5 release_notes
erpc bug 511312: nss fails to load softoken, looking for sqlite3.dll bug 511781: add new tls 1.2 cipher suites implemented in windows 7 to ssltap bug 516101: if pk11_importcert fails, it leaves the certificate undiscoverable by cert_pkixverifycert bug 518443: pk11_importandreturnprivatekey leaks an arena bug 518446: pk11_derencodepublickey leaks a certsubjectpublickeyinfo bug 518457: seckey_encodedersubjectpublickeyinfo and pk11_derencodepublickey are duplicate bug 522510: add deprecated comments to key.h and pk11func.h bug 522580: nss uses port_memcmp for comparing secret data.
NSS 3.14.1 release notes
new functions in ocspt.h cert_createocspsingleresponsegood cert_createocspsingleresponseunknown cert_createocspsingleresponserevoked cert_createencodedocspsuccessresponse cert_createencodedocsperrorresponse new types in ocspt.h ​certocspresponderidtype notable changes in nss 3.14.1 windows ce support has been removed from the code base.
NSS 3.16.1 release notes
new functions in pk11pub.h pk11_exportderprivatekeyinfo and pk11_exportprivkeyinfo - exports a private key in a der-encoded asn.1 privatekeyinfo type or a seckeyprivatekeyinfo structure.
NSS 3.19.2.4 release notes
security fixes in nss 3.19.2.4 the following security fixes from nss 3.21 have been backported to nss 3.19.2.4: bug 1185033 / cve-2016-1979 - use-after-free during processing of der encoded keys in nss bug 1209546 / cve-2016-1978 - use-after-free in nss during ssl connections in low memory bug 1190248 / cve-2016-1938 - errors in mp_div and mp_exptmod cryptographic functions in nss compatibility nss 3.19.2.4 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS 3.19 release notes
new functions in cert.h cert_getimposednameconstraints - check if any imposed constraints exist for the given certificate, and if found, return the constraints as encoded certificate extensions.
NSS 3.44 release notes
new in nss 3.44 new functionality new functions in lib/certdb/cert.h cert_getcertificateder - access the der-encoded form of a certcertificate.
Enc Dec MAC Output Public Key as CSR
rror writing wrapped aes key to cipher file - %s\n", encryptedfilename); goto cleanup; } rv = writetoheaderfile(wrappedmackey->data, wrappedmackey->len, mackey, headerfile); if (rv != secsuccess) { pr_fprintf(pr_stderr, "error writing wrapped mac key to cipher file - %s\n", headerfilename); goto cleanup; } pubkeydata = seckey_encodedersubjectpublickeyinfo(pubkey); rv = writetoheaderfile(pubkeydata->data, pubkeydata->len, pubkey, headerfile); if (rv != secsuccess) { pr_fprintf(pr_stderr, "error writing wrapped aes key to cipher file - %s\n", headerfilename); goto cleanup; } /* open the input file.
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
.\n"); goto cleanup; } result = (secitem *) port_arenazalloc (arena, sizeof (secitem)); if (result == null) { pr_fprintf(pr_stderr, "could not allocate item for certificate data.\n"); goto cleanup; } rv = sec_dersigndata(arena, result, der.data, der.len, privkey, algid); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not sign encoded certificate data : %s\n", port_errortostring(rv)); /* result allocated out of the arena, it will be freed * when the arena is freed */ result = null; goto cleanup; } cert->dercert = *result; cleanup: if (caprivatekey) { seckey_destroyprivatekey(caprivatekey); } return result; } /* * makev1cert */ st...
NSS Sample Code Sample1
cret_key_gen, 0, 160/8, 0); if (!key) { rv = 1; goto mac_done; } rv = wrapkey(key, pubkey, &mwrappedmackey); mac_done: if (key) pk11_freesymkey(key); } done: if (slot) pk11_freeslot(slot); return rv; } int server::exportpublickey(secitem **pubkeydata) { int rv = 0; seckeypublickey *pubkey = 0; rv = getpublickey(&pubkey); if (rv) goto done; *pubkeydata = seckey_encodedersubjectpublickeyinfo(pubkey); if (!*pubkeydata) { rv = 1; goto done; } done: if (pubkey) seckey_destroypublickey(pubkey); return rv; } int server::exportkeys(secitem *pubkeydata, secitem **wrappedenckey, secitem **wrappedmackey) { int rv; certsubjectpublickeyinfo *keyinfo = 0; seckeypublickey *pubkey = 0; secitem *data = 0; // make sure the keys are availab...
sample2
if (!dummy) { pr_fprintf(pr_stderr, "could not encode certificate.\n"); goto cleanup; } result = (secitem *) port_arenazalloc (arena, sizeof (secitem)); if (result == null) { pr_fprintf(pr_stderr, "could not allocate item for certificate data.\n"); goto cleanup; } rv = sec_dersigndata(arena, result, der.data, der.len, privkey, algid); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not sign encoded certificate data : %s\n", port_errortostring(rv)); /* result allocated out of the arena, it will be freed * when the arena is freed */ result = null; goto cleanup; } cert->dercert = *result; cleanup: if (caprivatekey) { seckey_destroyprivatekey(caprivatekey); } return result; } /* * makev1cert */ static certcertificate * makev1cert(certcertdbhandle *handle, certcertificaterequest *req, char * iss...
nss tech note7
call seckey_importderpublickey() with type=ckk_rsa to import a der-encoded rsa public key.
PKCS11 FAQ
MozillaProjectsNSSPKCS11FAQ
the public key is sent to the server base-64-der-encoded with an (optional) signed challenge.
NSS environment variables
see nss tracing 3.12 nss_use_decoded_cka_ec_point boolean (any value to enable) tells nss to send ec key points across the pkcs#11 interface in the non-standard unencoded format that was used by default before nss 3.12.3.
NSS functions
eneralizedtimearena mxr 3.11.7 and later der_utcdaytoascii mxr 3.2 and later der_utctimetoascii mxr 3.2 and later der_utctimetotime mxr 3.2 and later dsau_decodedersig mxr 3.2 and later dsau_decodedersigtolen mxr 3.9 and later dsau_encodedersig mxr 3.2 and later dsau_encodedersigwithlen mxr 3.9 and later hash_begin mxr 3.4 and later hash_clone mxr 3.10 and later hash_create mxr 3.4 and later hash_destroy mxr 3.4 and later hash_end mxr 3.4 and later ...
NSS tools : certutil
· oid (example): 1.2.3.4 · critical-flag: critical or not-critical · filename: full path to a file containing an encoded extension -f password-file specify a file that will automatically supply the password to include in a certificate or to access a certificate database.
NSS tools : crlutil
if located in file it should be encoded in asn.1 encode format.
NSS tools : ssltab
if the tool detects a certificate chain, it saves the der-encoded certificates into files in the current directory.
NSS tools : ssltap
if the tool detects a certificate chain, it saves the der-encoded certificates into files in the current directory.
NSS tools : vfychain
options -a the following certfile is base64 encoded -b yymmddhhmmz validate date (default: now) -d directory database directory -f enable cert fetching from aia url -o oid set policy oid for cert validation(format oid.1.2.3) -p use pkix library to validate certificate by calling: * cert_verifycertificate if specified once, * cert_pkixverifycert if specified twice and more.
ssltyp.html
syntax #include <seccomon.h> #include <prtypes.h> #include <secport.h> typedef enum { sibuffer, sicleardatabuffer, sicipherdatabuffer, sidercertbuffer, siencodedcertbuffer, sidernamebuffer, siencodednamebuffer, siasciinamestring, siasciistring, sideroid } secitemtype; typedef struct secitemstr secitem; struct secitemstr { secitemtype type; unsigned char *data; unsigned int len; }; description a secitem structure can be used to associate your own data with an ssl socket.
Utility functions
eneralizedtimearena mxr 3.11.7 and later der_utcdaytoascii mxr 3.2 and later der_utctimetoascii mxr 3.2 and later der_utctimetotime mxr 3.2 and later dsau_decodedersig mxr 3.2 and later dsau_decodedersigtolen mxr 3.9 and later dsau_encodedersig mxr 3.2 and later dsau_encodedersigwithlen mxr 3.9 and later hash_begin mxr 3.4 and later hash_clone mxr 3.10 and later hash_create mxr 3.4 and later hash_destroy mxr 3.4 and later hash_end mxr 3.4 and later ...
NSS Tools ssltap
if the tool detects a certificate chain, it saves the der-encoded certificates into files in the current directory.
NSS tools : crlutil
MozillaProjectsNSStoolscrlutil
if located in file it should be encoded in asn.1 encode format.
NSS tools : signver
MozillaProjectsNSStoolssignver
synopsis signtool -a | -v -d directory [-a] [-i input_file] [-o output_file] [-s signature_file] [-v] description the signature verification tool, signver, is a simple command-line utility that unpacks a base-64-encoded pkcs#7 signed object and verifies the digital signature using standard cryptographic techniques.
NSS tools : ssltap
MozillaProjectsNSStoolsssltap
if the tool detects a certificate chain, it saves the der-encoded certificates into files in the current directory.
NSS tools : vfychain
options -a the following certfile is base64 encoded -b yymmddhhmmz validate date (default: now) -d directory database directory -f enable cert fetching from aia url -o oid set policy oid for cert validation(format oid.1.2.3) -p use pkix library to validate certificate by calling: * cert_verifycertificate if specified once, * cert_pkixverifycert if s...
Index
it returns the length of the whole string encoding or (size_t)-1 if the string can't be encoded as bytes.
Bytecode Descriptions
resumekind operands: (generatorresumekind resumekind (encoded as uint8_t)) stack: ⇒ resumekind pushes one of the generatorresumekind values as int32value.
Statistics API
the browser preference javascript.options.mem.notify controls emission of json encoded gc stats to an observer interface.
SpiderMonkey Internals
other values are encoded as a value and a type tag: on x86, arm, and similar 32-bit platforms, we use what we call "nunboxing", in which non-double values are a 32-bit type tag and a 32-bit payload, which is normally either a pointer or a signed 32-bit integer.
JSAPI User Guide
the "uc" versions of these calls provide support for unicode-encoded scripts.
JS::DeflateStringToUTF8Buffer
this can be less than the length of the string, if the buffer is exhausted before the string is fully encoded.
JSPrincipalsTranscoder
the callback xdr-encodes or -decodes a principals instance, based on whether xdr->mode is jsxdr_encode, in which case *principalsp should be encoded; or jsxdr_decode, in which case implementations must return a held (via jsprincipals_hold), non-null *principalsp out parameter.
SpiderMonkey 1.8.5
while this was never specified behaviour, it is no longer true; numeric values which are integers are frequently encoded as jsdouble inside the jsval.
SpiderMonkey 1.8.7
while this was never specified behaviour, it is no longer true; numeric values which are integers are frequently encoded as jsdouble inside the jsval.
A Web PKI x509 certificate primer
error code what it means what can i do sec_error_bad_der a certificate is not properly encoded according to asn.1 (der) encoding re-generate the improperly-encoded certificate sec_error_ca_cert_invalid an end-entity certificate is being used to issue another certificate ensure that any certificate intended to issue certificates has a basic constraints extension with ca: true sec_error_bad_signature a signature on a certificate is improperly formatted or the ce...
Animated PNG graphics
MozillaTechAPNG
subsequent frames are encoded in 'fdat' chunks, which have the same structure as 'idat' chunks, except preceded by a sequence number.
Feed content access API
the title is an nsifeedtextconstruct that can represent the text in various formats; we get its text property to fetch the feed's title as html-encoded text.
The Places database
if the mime type of the image is image/png, the data blob must be reencoded from base16 (the format in which it is stored) to base64 in order to display correctly.
XPCOM array guide
MozillaTechXPCOMGuideArrays
both unicode strings and utf8-encoded strings are supported.
Components.utils.Sandbox
indexeddb (web worker only) xmlhttprequest textencoder textdecoder url urlsearchparams atob btoa blob file crypto rtcidentityprovider fetch (added in firefox 41) caches filereader for example: var sandboxscript = 'var encoded = btoa("hello");' + 'var decoded = atob(encoded);'; var options = { "wantglobalproperties": ["atob", "btoa"] } var sandbox = components.utils.sandbox("https://example.org/", options); components.utils.evalinsandbox(sandboxscript, sandbox); console.log(sandbox.encoded); // "sgvsbg8=" console.log(sandbox.decoded); // "hello" wantxhrconstructor this option ...
Components.utils.importGlobalProperties
example components.utils.import("resource://gre/modules/devtools/console.jsm"); components.utils.importglobalproperties(["atob", "btoa"]); var encoded = btoa("hello"); console.log(encoded); // "sgvsbg8=" console.log(atob(encoded)); // "hello" alternative methods if importglobalproperties does not support the targeted firefox version, here are some alternative methods to import these objects.
NS_NewNativeLocalFile
this string should be encoded using ascii or the multibyte character coding corresponding to the native filesystem.
imgIDecoder
unsigned long writefrom( in nsiinputstream instr, in unsigned long count ); parameters instr the stream from which to read the encoded image data.
mozIStorageStatement
return value an utf-16 encoded string that has characters that have special meaning escaped from avalue.
nsIBinaryOutputStream
writeutf8z() writes an 8-bit pascal style string (utf8-encoded) to the stream.
nsIContentFrameMessageManager
returns string: the base64-encoded ascii string.
nsIDOMHTMLSourceElement
the codecs parameter may be specified and might be necessary to specify exactly how the resource is encoded.
nsIDirIndex
this is encoded with the encoding specified in the nsidirindexparser, and is also escaped.
nsIDocShell
in mozilla code, all text is encoded as unicode.
nsIEffectiveTLDService
remarks all returned strings are encoded in ascii/ace and normalized according to rfc 3454.
nsIFeedContainer
common atom and rss fields are normalized, including some namespaced extensions such as "dc:subject" and "content:encoded".
nsIFeedEntry
this comes from the atom:content and/or content:encoded fields.
nsIMIMEInputStream
example var postdata = components.classes["@mozilla.org/network/mime-input-stream;1"] .createinstance(components.interfaces.nsimimeinputstream); postdata.addheader("content-type", "application/x-www-form-urlencoded"); postdata.addcontentlength = true; postdata.setdata(stringstream); ...
nsIMsgDBHdr
the value here will effectively be the unparsed header content, so it will contain full mime-encoded syntax.
nsISHEntry
(prior to gecko 6.0 returned a json encoded string.) sticky boolean whether the content viewer is marked "sticky" windowstate nsisupports saved state of the global window object.
nsIScriptableInputStream
in particular, some bindings may convert the byte values into unicode code points, by assuming the byte values are encoded as iso-latin-1.
nsIUploadChannel
acontenttype if acontenttype is empty, the protocol will assume that no content headers are to be added to the uploaded stream and that any required headers are already encoded in the stream.
nsIWebBrowserPersist
persist_flags_autodetect_apply_conversion 16384 let the webbrowserpersist decide whether the incoming data is encoded and whether it needs to go through a content converter, for example to decompress it.
nsIWebappsSupport
icondata a base64 encoded representation of the application's icon.
NS_CStringToUTF16
the result will be encoded using the host byte order.
NS_UTF16ToCString
the source string should be encoded using the host byte order.
Use SQLite
const cc = components.classes; const ci = components.interfaces; var tbirdsqlite = { onload: function() { // initialization code this.initialized = true; this.dbinit(); }, dbconnection: null, dbschema: { tables: { attachments:"id integer primary key, \ name text \ encoded text not null" } }, dbinit: function() { var dirservice = cc["@mozilla.org/file/directory_service;1"].
Plug-in Development Overview - Plugins
the returned value is the unicode serialization of the document's origin converted to nfkc-encoded (that is, normalized) utf-8.
URLs - Plugins
char* ppostdata = "content-type:\tapplication/x-www-form-urlencoded\ncontent-length:\t17\n\nname=aaashun@gmail.com\n"; uint32 npostdatalen = (uint32)strlen(ppostdata); npn_posturl(npinstance, "http://www.baidu.com","_blank", npostdatalen, ppostdata, false); uploading files to an ftp server plug-ins can use npn_posturl or npn_posturlnotify to upload files to a remote server using ftp.
Network request list - Firefox Developer Tools
copy as curl the command may include the following options: -x [method] if the method is not get or post --data for url encoded request parameters --data-binary for multipart request parameters --http/version if the http version is not 1.1 -i if the method is head -h one for each request header.
AuthenticatorAssertionResponse.authenticatorData - Web APIs
credentialpublickey (variable length) - a cose encoded public key.
Blob() - Web APIs
WebAPIBlobBlob
usvstring objects are encoded as utf-8.
CSSStyleSheet.insertRule() - Web APIs
* @param {array} rules accepts an array of json-encoded declarations * @example addstylesheetrules([ ['h2', // also accepts a second argument as an array of arrays instead ['color', 'red'], ['background-color', 'green', true] // 'true' for !important rules ], ['.myclass', ['background-color', 'yellow'] ] ]); */ function addstylesheetrules (rules) { var styleel = document.createelement('style'); // append <style> element to <h...
Binary strings - Web APIs
WebAPIDOMStringBinary
javascript strings are utf-16 encoded strings.
File.File() - Web APIs
WebAPIFileFile
usvstring objects are encoded as utf-8.
File.getAsText() - Web APIs
WebAPIFilegetAsText
owed media types var accept = { binary : ["image/png", "image/jpeg"], text : ["text/plain", "text/css", "application/xml", "text/html"] }; var file; for (var i = 0; i < files.length; i++) { file = files[i]; // if file type could be detected if (file !== null) { if (accept.text.indexof(file.mediatype) > -1) { // file is of type text, which we accept // make sure it's encoded as utf-8 var data = file.getastext("utf-8"); // modify data with string methods } else if (accept.binary.indexof(file.mediatype) > -1) { // binary } } } specification not part of any specification.
KeyboardEvent - Web APIs
the numlock key does not fall into this group and is always encoded with the location dom_key_location_standard.
MediaCapabilitiesInfo - Web APIs
properties the mediacapabilitiesinfo interface contains three boolean attribues: supported: given the properties defined in the mediaconfiguration, can the specified piece of media content be encoded (if mediaencodingconfiguration is set) or decode (if mediadecodingconfiguration is set) at all?
MediaSource.endOfStream() - Web APIs
this can be used to indicate that a parsing error has occured while fetching media data; maybe the data is corrupt, or is encoded using a codec that the browser doesn't know how to decode.
Transcoding assets for Media Source Extensions - Web APIs
summary with your video properly encoded and adaptive bitrate media generated, you're now ready to begin adaptive bitrate streaming on the web using dash and mse.
NDEFRecord.data - Web APIs
WebAPINDEFRecorddata
syntax ndefrecord.data value a dataview that contains encoded payload data of the record.
NDEFRecord - Web APIs
ndefrecord.lang read only represents a language tag of the content, if it was encoded.
NotifyAudioAvailableEvent - Web APIs
encoded audio).
PerformanceResourceTiming.decodedBodySize - Web APIs
if ("decodedbodysize" in perfentry) console.log("decodedbodysize = " + perfentry.decodedbodysize); else console.log("decodedbodysize = not supported"); if ("encodedbodysize" in perfentry) console.log("encodedbodysize = " + perfentry.encodedbodysize); else console.log("encodedbodysize = not supported"); if ("transfersize" in perfentry) console.log("transfersize = " + perfentry.transfersize); else console.log("transfersize = not supported"); } function check_performanceentries() { // use getentriesbytype() to just get the "resource" ev...
PerformanceResourceTiming.transferSize - Web APIs
if ("decodedbodysize" in perfentry) console.log("decodedbodysize = " + perfentry.decodedbodysize); else console.log("decodedbodysize = not supported"); if ("encodedbodysize" in perfentry) console.log("encodedbodysize = " + perfentry.encodedbodysize); else console.log("encodedbodysize = not supported"); if ("transfersize" in perfentry) console.log("transfersize = " + perfentry.transfersize); else console.log("transfersize = not supported"); } function check_performanceentries() { // use getentriesbytype() to just get the "resource" ev...
PerformanceResourceTiming - Web APIs
performanceresourcetiming.encodedbodysizeread only a number representing the size (in octets) received from the fetch (http or cache), of the payload body, before removing any applied content-codings.
Performance API - Web APIs
resource timing level 2 working draft adds the nexthopprotocol, workerstart, transfersize, encodedbodysize, and decodedbodysize properties to the performanceresourcetiming interface.
PublicKeyCredential.rawId - Web APIs
the publickeycredential.id property is a base64url encoded version of this identifier.
PushManager.subscribe() - Web APIs
applicationserverkey: a base64-encoded domstring or arraybuffer containing an ecdsa p-256 public key that the push server will use to authenticate your application server.
RTCIceCandidate.candidate - Web APIs
the complete list of attributes for this example candidate is: foundation = 4234997325 component = "rtp" (the number 1 is encoded to this string; 2 becomes "rtcp") protocol = "udp" priority = 2043278322 ip = "192.168.0.56" port = 44323 type = "host" example in this example, we see a function which receives as input an sdp string containing an ice candidate received from the remote peer during the signaling process.
RTCIceCandidateInit.candidate - Web APIs
the complete list of attributes for this example candidate is: foundation = 4234997325 component = "rtp" (the number 1 is encoded to this string; 2 becomes "rtcp") protocol = "udp" priority = 2043278322 ip = "192.168.0.56" port = 44323 type = "host" example when a new ice candidate is received by your signaling code from the remote peer, you need to construct the rtcicecandidate object that encapsulates it.
RTCInboundRtpStreamStats.pliCount - Web APIs
a pli packet indicates that some amount of encoded video data has been lost for one or more frames.
RTCInboundRtpStreamStats - Web APIs
plicount an integer specifying the number of times the receiver has notified the sender that some amount of encoded video data for one or more frames has been lost, using picture loss indication (pli) packets.
RTCOutboundRtpStreamStats.pliCount - Web APIs
a pli packet indicates that some amount of encoded video data has been lost for one or more frames.
RTCOutboundRtpStreamStats.qualityLimitationReason - Web APIs
the amount of time the encoded media has had its quality reduced in each of the potential ways that can be done can be found in qualitylimitationdurations.
RTCRtpEncodingParameters.maxBitrate - Web APIs
the rtcrtpencodingparameters dictionary's maxbitrate property specifies the maximum number of bits per second to allow a track encoded with this encoding to use.
RTCRtpEncodingParameters.scaleResolutionDownBy - Web APIs
the default value, 1.0, means that the video will be encoded at its original size.
RTCRtpSender.replaceTrack() - Web APIs
the new track is a video track and its raw or pre-encoded state differs from that of the original track.
RTCRtpStreamStats.pliCount - Web APIs
a pli packet indicates that some amount of encoded video data has been lost for one or more frames.
ReadableStream.pipeThrough() - Web APIs
for example, a textdecoder, has bytes written to it and strings read from it, while a video decoder has encoded bytes written to it and uncompressed video frames read from it.
Resource Timing API - Web APIs
the encodedbodysize property returns the size (in octets) received from the fetch (http or cache), of the payload body, before removing any applied content-codings.
Using server-sent events - Web APIs
evtsource.close(); event stream format the event stream is a simple stream of text data which must be encoded using utf-8.
Using readable streams - Web APIs
note: in order to consume a stream using fetchevent.respondwith(), the enqueued stream contents must be of type uint8array; for example, encoded using textencoder.
TextDecoder.prototype.decode() - Web APIs
html <p>encoded value: <span id="encoded-value"></span></p> <p>decoded value: <span id="decoded-value"></span></p> javascript const encoder = new textencoder(); const array = encoder.encode('€'); // uint8array(3) [226, 130, 172] document.getelementbyid('encoded-value').textcontent = array; const decoder = new textdecoder(); const str = decoder.decode(array); // string "€" document.getelementbyid('decoded-...
URL - Web APIs
WebAPIURL
a url parameter, and an optional base parameter to use as a base if the url parameter is a relative url: const url = new url('../cats', 'http://www.example.com/dogs'); console.log(url.hostname); // "www.example.com" console.log(url.pathname); // "/cats" url properties can be set to construct the url: url.hash = 'tabby'; console.log(url.href); // "http://www.example.com/cats#tabby" urls are encoded according to the rules found in rfc 3986.
URLSearchParams() - Web APIs
syntax var urlsearchparams = new urlsearchparams(init); parameters init optional one of: a usvstring, which will be parsed from application/x-www-form-urlencoded format.
URL API - Web APIs
WebAPIURL API
the url standard also defines concepts such as domains, hosts, and ip addresses, and also attempts to describe in a standard way the legacy application/x-www-form-urlencoded mime type used to submit web forms' contents as a set of key/value pairs.
Web Video Text Tracks Format (WebVTT) - Web APIs
webvtt is a text based format, which must be encoded using utf-8.
Migrating from webkitAudioContext - Web APIs
the standard audiocontext api: var osc = context.createoscillator(); osc.start(1); osc.stop(1.5); var src = context.createbuffersource(); src.start(1, 0.25); src.stop(2); remove synchronous buffer creation in the old webkit implementation of web audio, there were two versions of createbuffer(), one which created an initially empty buffer, and one which took an existing arraybuffer containing encoded audio, decoded it and returned the result in the form of an audiobuffer.
Web Authentication API - Web APIs
the publickeycredential is sent back to the server using any desired formatting and protocol (note that the arraybuffer properties need to be be base64 encoded or similar).
WritableStream.WritableStream() - Web APIs
const list = document.queryselector('ul'); function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter const defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defaultwriter.write(chunk); }) .then(() => { console.log("chunk written to sink."); }) .catch((err) => { console.log("chunk error:", err); }); }); // call ready again to ensure that all chunks are written // be...
WritableStream.getWriter() - Web APIs
const list = document.queryselector('ul'); function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter const defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defaultwriter.write(chunk); }) .then(() => { console.log("chunk written to sink."); }) .catch((err) => { console.log("chunk error:", err); }); }); // call ready again to ensure that all chunks are written // be...
WritableStream - Web APIs
const list = document.queryselector('ul'); function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter const defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defaultwriter.write(chunk); }) .then(() => { console.log("chunk written to sink."); }) .catch((err) => { console.log("chunk error:", err); }); }); // call ready again to ensure that all chunks are written // be...
WritableStreamDefaultWriter.WritableStreamDefaultWriter() - Web APIs
const list = document.queryselector('ul'); function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter const defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defaultwriter.write(chunk); }) .then(() => { console.log("chunk written to sink."); }) .catch((err) => { console.log("chunk error:", err); }); }); // call ready again to ensure that all chunks are written // be...
WritableStreamDefaultWriter.close() - Web APIs
const list = document.queryselector('ul'); function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter const defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defaultwriter.write(chunk); }) .then(() => { console.log("chunk written to sink."); }) .catch((err) => { console.log("chunk error:", err); }); }); // call ready again to ensure that all chunks are written // be...
WritableStreamDefaultWriter.ready - Web APIs
function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter var defaultwriter = writablestream.getwriter(); var encoder = new textencoder(); var encoded = encoder.encode(message, {stream: true}); encoded.foreach(function(chunk) { // make sure the stream and its writer are able to // receive data.
WritableStreamDefaultWriter.write() - Web APIs
const list = document.queryselector('ul'); function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter const defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defaultwriter.write(chunk); }) .then(() => { console.log("chunk written to sink."); }) .catch((err) => { console.log("chunk error:", err); }); }); // call ready again to ensure that all chunks are written // be...
WritableStreamDefaultWriter - Web APIs
const list = document.queryselector('ul'); function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter const defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defaultwriter.write(chunk); }) .then(() => { console.log("chunk written to sink."); }) .catch((err) => { console.log("chunk error:", err); }); }); // call ready again to ensure that all chunks are writ...
XMLHttpRequest.send() - Web APIs
}; xhr.send(null); // xhr.send('string'); // xhr.send(new blob()); // xhr.send(new int8array()); // xhr.send(document); example: post var xhr = new xmlhttprequest(); xhr.open("post", '/server', true); //send the proper header information along with the request xhr.setrequestheader("content-type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { // call a function when the state changes.
Variable fonts guide - CSS: Cascading Style Sheets
if a number value supplied is outside the range encoded in the font, the browser should render the font at the closest value allowed.
content - CSS: Cascading Style Sheets
WebCSScontent
non-latin characters must be encoded using their unicode escape sequences: for example, \000a9 represents the copyright symbol.
counters() - CSS: Cascading Style Sheets
WebCSScounters
non-latin characters must be encoded using their unicode escape sequences: for example, \000a9 represents the copyright symbol.
image-orientation - CSS: Cascading Style Sheets
will not apply any additional image rotation; the image is oriented as encoded or as other css property values dictate.
Cross-browser audio basics - Developer guides
mp4 files typically contain aac encoded audio.
Video player styling basics - Developer guides
each image was then converted to a base64 encoded string (using an online base64 image encoder), since the images are quite small, the resultant encoded strings are quite short.
Localizations and character encodings - Developer guides
in these locales, legacy content that doesn't declare its encoding is typically encoded using a legacy encoding other than windows-1252.
<button>: The Button element - HTML: Hypertext Markup Language
WebHTMLElementbutton
possible values: application/x-www-form-urlencoded: the default if the attribute is not used.
<form> - HTML: Hypertext Markup Language
WebHTMLElementform
possible values: application/x-www-form-urlencoded: the default value.
<input type="time"> - HTML: Hypertext Markup Language
WebHTMLElementinputtime
var starttime = document.getelementbyid("starttime"); var valuespan = document.getelementbyid("value"); starttime.addeventlistener("input", function() { valuespan.innertext = starttime.value; }, false); when a form including a time input is submitted, the value is encoded before being included in the form's data.
<link>: The External Resource Link element - HTML: Hypertext Markup Language
WebHTMLElementlink
integrity contains inline metadata — a base64-encoded cryptographic hash of the resource (file) you’re telling the browser to fetch.
<meta>: The Document-level Metadata element - HTML: Hypertext Markup Language
WebHTMLElementmeta
if the charset attribute is set, the meta element is a charset declaration, giving the character encoding in which the document is encoded.
<wbr> - HTML: Hypertext Markup Language
WebHTMLElementwbr
notes on utf-8 encoded pages, <wbr> behaves like the u+200b zero-width space code point.
Basics of HTTP - HTTP
this article explains the frame structure, its purpose, and the way it's encoded.
Cross-Origin Resource Sharing (CORS) - HTTP
WebHTTPCORS
he only headers which are allowed to be manually set are those which the fetch spec defines as a “cors-safelisted request-header”, which are: accept accept-language content-language content-type (but note the additional requirements below) dpr downlink save-data viewport-width width the only allowed values for the content-type header are: application/x-www-form-urlencoded multipart/form-data text/plain no event listeners are registered on any xmlhttprequestupload object used in the request; these are accessed using the xmlhttprequest.upload property.
Authorization - HTTP
the resulting string is base64 encoded (ywxhzgrpbjpvcgvuc2vzyw1l).
CSP: base-uri - HTTP
the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style.
CSP: child-src - HTTP
the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style.
CSP: connect-src - HTTP
the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style.
CSP: default-src - HTTP
the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style.
CSP: font-src - HTTP
the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style.
CSP: form-action - HTTP
the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style.
CSP: frame-src - HTTP
the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style.
CSP: img-src - HTTP
the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style.
CSP: manifest-src - HTTP
the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style.
CSP: media-src - HTTP
the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style.
CSP: navigate-to - HTTP
the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style.
CSP: object-src - HTTP
the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style.
CSP: prefetch-src - HTTP
the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style.
CSP: script-src-attr - HTTP
the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style.
CSP: script-src-elem - HTTP
the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style.
CSP: style-src-attr - HTTP
the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style.
CSP: style-src-elem - HTTP
the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style.
CSP: style-src - HTTP
the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style.
CSP: worker-src - HTTP
the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style.
Content-Type - HTTP
it also needs to have a mime type of its parsed value (ignoring parameters) of either application/x-www-form-urlencoded, multipart/form-data, or text/plain.
Proxy-Authorization - HTTP
the resulting string is base64 encoded (ywxhzgrpbjpvcgvuc2vzyw1l).
Public-Key-Pins-Report-Only - HTTP
header type response header forbidden header name no syntax public-key-pins-report-only: pin-sha256="<pin-value>"; max-age=<expire-time>; includesubdomains; report-uri="<uri>" directives pin-sha256="<pin-value>" the quoted string is the base64 encoded subject public key information (spki) fingerprint.
Public-Key-Pins - HTTP
header type response header forbidden header name no syntax public-key-pins: pin-sha256="<pin-value>"; max-age=<expire-time>; includesubdomains; report-uri="<uri>" directives pin-sha256="<pin-value>" the quoted string is the base64 encoded subject public key information (spki) fingerprint.
Sec-WebSocket-Accept - HTTP
header type response header forbidden header name no syntax sec-websocket-accept: <hashed key> directives <hashed key> the server takes the value of the sec-websocket-key sent in the handshake request, appends 258eafa5-e914-47da-95ca-c5ab0dc85b11, takes sha-1 of the new value, and is then base64 encoded.
Network Error Logging - HTTP
usage web applications opt in to this behaviour with the nel header, which is a json-encoded object: nel: { "report_to": "nel", "max_age": 31556952 } an origin considered secure by the browser is required.
Protocol upgrade mechanism - HTTP
that value is then base64 encoded to obtain the value of this property.
A typical HTTP session - HTTP
WebHTTPSession
for example, sending the result of a form: post /contact_form.php http/1.1 host: developer.mozilla.org content-length: 64 content-type: application/x-www-form-urlencoded name=joe%20user&request=send%20me%20one%20of%20your%20catalogue request methods http defines a set of request methods indicating the desired action to be performed upon a resource.
Array.prototype.sort() - JavaScript
note : in utf-16, unicode characters above \uffff are encoded as two surrogate code units, of the range \ud800-\udfff.
Intl.Locale.prototype.toString() - JavaScript
information about a particular locale (language, script, calendar type, etc.) can be encoded in a locale identifier string.
JSON.stringify() - JavaScript
before this change json.stringify would output lone surrogates if the input contained any lone surrogates; such strings could not be encoded in valid utf-8 or utf-16: json.stringify("\ud800"); // '"�"' but with this change json.stringify represents lone surrogates using json escape sequences that can be encoded in valid utf-8 or utf-16: json.stringify("\ud800"); // '"\\ud800"' this change should be backwards-compatible as long as you pass the result of json.stringify to apis such as json.parse that will accept any valid json tex...
Lexical grammar - JavaScript
when generating these string values unicode code points are utf-16 encoded.
Media type and format guide: image, audio, and video content - Web media technologies
WebMediaFormats
codecs used by webrtc webrtc doesn't use a container, but instead streams the encoded media itself from peer to peer using mediastreamtrack objects to represent each audio or video track.
Navigation and resource timings - Web Performance
let compressionsavings = 1 - (timing.transfersize / timing.decodedbodysize) we could have used let compressionsavings = 1 - (timing.encodedbodysize / timing.decodedbodysize) but using transfersize includes the overhead bytes.
Getting started - SVG: Scalable Vector Graphics
if your server is not configured to send the correct headers with the svg files it serves, then firefox will most likely show the markup of the files as text or encoded garbage, or even ask the viewer to choose an application to open them.
Compiling an Existing C Module to WebAssembly - WebAssembly
for example, v0.6.1 is encoded as 0x000601 = 1537.