[CI Skip] 0.34.31
This commit is contained in:
@@ -0,0 +1 @@
|
||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[193],{352:function(t,a,n){"use strict";n.r(a);var s=n(46),e=Object(s.a)({},function(){var t=this,a=t.$createElement,n=t._self._c||a;return n("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[n("h1",{attrs:{id:"functions"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#functions","aria-hidden":"true"}},[t._v("#")]),t._v(" Functions")]),t._v(" "),n("p",[n("a",{attrs:{id:"compactstriplength"}})]),t._v(" "),n("h2",{attrs:{id:"compactstriplength"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#compactstriplength","aria-hidden":"true"}},[t._v("#")]),t._v(" compactStripLength")]),t._v(" "),n("p",[t._v("▸ "),n("strong",[t._v("compactStripLength")]),t._v("(input: "),n("em",[n("code",[t._v("Uint8Array")])]),t._v(", bitLength?: "),n("em",[n("router-link",{attrs:{to:"/util/modules/_compact_types_.html#bitlength"}},[t._v("BitLength")])],1),t._v("): ["),n("code",[t._v("number")]),t._v(", "),n("code",[t._v("Uint8Array")]),t._v("]")]),t._v(" "),n("p",[n("em",[t._v("Defined in "),n("a",{attrs:{href:"https://github.com/polkadot-js/common/blob/e397016/packages/util/src/compact/stripLength.ts#L22",target:"_blank",rel:"noopener noreferrer"}},[t._v("compact/stripLength.ts:22"),n("OutboundLink")],1)])]),t._v(" "),n("p",[n("em",[n("strong",[t._v("name")])]),t._v(": compactStripLength")]),t._v(" "),n("p",[n("em",[n("strong",[t._v("description")])]),t._v(": Removes the length prefix, returning both the total length (including the value + compact encoding) and the decoded value with the correct length")]),t._v(" "),n("p",[n("em",[n("strong",[t._v("example")])]),t._v(":")]),t._v(" "),n("div",{staticClass:"language-javascript line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-javascript"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" compactStripLength "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v("'@polkadot/util'")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nconsole"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("compactStripLength")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Uint8Array")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<<")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("0xde")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("0xad")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// [2, Uint8Array[0xde, 0xad]]")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br")])]),n("p",[n("strong",[t._v("Parameters:")])]),t._v(" "),n("table",[n("thead",[n("tr",[n("th",[t._v("Name")]),t._v(" "),n("th",[t._v("Type")]),t._v(" "),n("th",[t._v("Default value")])])]),t._v(" "),n("tbody",[n("tr",[n("td",[t._v("input")]),t._v(" "),n("td",[n("code",[t._v("Uint8Array")])]),t._v(" "),n("td",[t._v("-")])]),t._v(" "),n("tr",[n("td",[n("code",[t._v("Default value")]),t._v(" bitLength")]),t._v(" "),n("td",[n("router-link",{attrs:{to:"/util/modules/_compact_types_.html#bitlength"}},[t._v("BitLength")])],1),t._v(" "),n("td",[t._v("DEFAULT_BITLENGTH")])])])]),t._v(" "),n("p",[n("strong",[t._v("Returns:")]),t._v(" ["),n("code",[t._v("number")]),t._v(", "),n("code",[t._v("Uint8Array")]),t._v("]")]),t._v(" "),n("hr")])},[],!1,null,null,null);a.default=e.exports}}]);
|
||||
Reference in New Issue
Block a user