Mercurial > hg > nginx-site
comparison xml/en/docs/njs/njs_api.xml @ 2211:660229c5c92f
Documented String.bytesFrom() method in njs.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Tue, 31 Jul 2018 16:41:06 +0300 |
parents | 6f9fd9677d1b |
children | c34a885b9d99 |
comparison
equal
deleted
inserted
replaced
2210:da8e5d713962 | 2211:660229c5c92f |
---|---|
7 <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd"> | 7 <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd"> |
8 | 8 |
9 <article name="njs API" | 9 <article name="njs API" |
10 link="/en/docs/njs/njs_api.html" | 10 link="/en/docs/njs/njs_api.html" |
11 lang="en" | 11 lang="en" |
12 rev="3"> | 12 rev="4"> |
13 | 13 |
14 <section id="summary"> | 14 <section id="summary"> |
15 | 15 |
16 <para> | 16 <para> |
17 <link doc="../njs_about.xml">njs</link> provides objects, methods and properties | 17 <link doc="../njs_about.xml">njs</link> provides objects, methods and properties |
68 >> 'αβγδ'.toUTF8().toString('base64') | 68 >> 'αβγδ'.toUTF8().toString('base64') |
69 zrHOss6zzrQ= | 69 zrHOss6zzrQ= |
70 </example> | 70 </example> |
71 | 71 |
72 <list type="tag"> | 72 <list type="tag"> |
73 | |
74 <tag-name id="string_bytesfrom"><literal>String.bytesFrom(<value>array</value> | |
75 | <value>string</value>, <value>encoding</value>)</literal></tag-name> | |
76 <tag-desc> | |
77 (njs specific) Creates a byte string either from an array that contains octets, | |
78 or from an encoded string (0.2.3). | |
79 The encoding can be | |
80 <literal>hex</literal>, | |
81 <literal>base64</literal>, and | |
82 <literal>base64url</literal>. | |
83 <example> | |
84 >> String.bytesFrom([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]) | |
85 'buffer' | |
86 | |
87 >> String.bytesFrom('YnVmZmVy', 'base64') | |
88 'buffer' | |
89 </example> | |
90 </tag-desc> | |
73 | 91 |
74 <tag-name><literal>String.fromCodePoint(<value>codePoint1</value>[, ...[, | 92 <tag-name><literal>String.fromCodePoint(<value>codePoint1</value>[, ...[, |
75 <value>codePoint2</value>]])</literal></tag-name> | 93 <value>codePoint2</value>]])</literal></tag-name> |
76 <tag-desc> | 94 <tag-desc> |
77 Returns a string from one or more Unicode code points. | 95 Returns a string from one or more Unicode code points. |