From 3e1ddc35e0589a15fd8d3b56ca92efb3aea6bbf9 Mon Sep 17 00:00:00 2001 From: Supereg Date: Tue, 9 Mar 2021 12:33:57 +0100 Subject: [PATCH] Update docs --- docs/assets/css/main.css | 6 ++++++ docs/assets/js/main.js | 2 +- docs/classes/srp.html | 10 ++++----- docs/classes/srpclient.html | 12 +++++------ docs/classes/srpserver.html | 36 +++++++++++++++---------------- docs/index.html | 10 ++++----- docs/interfaces/baseidentity.html | 4 ++-- docs/interfaces/srpparams.html | 8 +++---- docs/modules.html | 10 ++++----- 9 files changed, 52 insertions(+), 46 deletions(-) diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css index 01cd747..ca83efe 100644 --- a/docs/assets/css/main.css +++ b/docs/assets/css/main.css @@ -1616,6 +1616,12 @@ pre code { background-color: transparent; } +blockquote { + margin: 1em 0; + padding-left: 1em; + border-left: 4px solid gray; +} + .tsd-typography { line-height: 1.333em; } diff --git a/docs/assets/js/main.js b/docs/assets/js/main.js index f8f96a6..715fdab 100644 --- a/docs/assets/js/main.js +++ b/docs/assets/js/main.js @@ -103,7 +103,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"initSearch\": () => /* binding */ initSearch\n/* harmony export */ });\n/* harmony import */ var _utils_debounce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/debounce */ \"./default/assets/js/src/typedoc/utils/debounce.ts\");\n/* harmony import */ var lunr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lunr */ \"../node_modules/lunr/lunr.js\");\n/* harmony import */ var lunr__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lunr__WEBPACK_IMPORTED_MODULE_1__);\n\n\nfunction initSearch() {\n var searchEl = document.getElementById(\"tsd-search\");\n if (!searchEl)\n return;\n var searchScript = document.getElementById(\"search-script\");\n if (searchScript) {\n searchScript.addEventListener(\"error\", function () {\n searchEl.classList.remove(\"loading\");\n searchEl.classList.add(\"failure\");\n });\n searchScript.addEventListener(\"load\", function () {\n searchEl.classList.remove(\"loading\");\n searchEl.classList.add(\"ready\");\n });\n }\n searchEl.classList.add(\"loading\");\n var field = document.querySelector(\"#tsd-search-field\");\n var results = document.querySelector(\".results\");\n if (!field || !results) {\n throw new Error(\"The input field or the result list wrapper was not found\");\n }\n field.addEventListener(\"focus\", function () { return searchEl.classList.add(\"has-focus\"); });\n field.addEventListener(\"blur\", function () {\n // Delay a bit so that mouse clicks don't get swallowed\n setTimeout(function () { return searchEl.classList.remove(\"has-focus\"); }, 100);\n });\n var state = {\n base: searchEl.dataset.base + \"/\",\n };\n bindEvents(searchEl, results, field, state);\n}\nfunction bindEvents(searchEl, results, field, state) {\n field.addEventListener(\"input\", (0,_utils_debounce__WEBPACK_IMPORTED_MODULE_0__.debounce)(function () {\n updateResults(searchEl, results, field, state);\n }, 200));\n var preventPress = false;\n field.addEventListener(\"keydown\", function (e) {\n preventPress = true;\n if (e.key == \"Enter\") {\n gotoCurrentResult(results, field);\n }\n else if (e.key == \"Escape\") {\n field.blur();\n }\n else if (e.key == \"ArrowUp\") {\n setCurrentResult(results, -1);\n }\n else if (e.key === \"ArrowDown\") {\n setCurrentResult(results, 1);\n }\n else {\n preventPress = false;\n }\n });\n field.addEventListener(\"keypress\", function (e) {\n if (preventPress)\n e.preventDefault();\n });\n /**\n * Start searching by pressing slash.\n */\n document.body.addEventListener(\"keydown\", function (e) {\n if (e.altKey || e.ctrlKey || e.metaKey)\n return;\n if (!field.matches(\":focus\") && e.key === \"/\") {\n field.focus();\n e.preventDefault();\n }\n });\n}\nfunction checkIndex(state, searchEl) {\n if (state.index)\n return;\n if (window.searchData) {\n searchEl.classList.remove(\"loading\");\n searchEl.classList.add(\"ready\");\n state.data = window.searchData;\n state.index = lunr__WEBPACK_IMPORTED_MODULE_1__.Index.load(window.searchData.index);\n }\n}\nfunction updateResults(searchEl, results, query, state) {\n checkIndex(state, searchEl);\n // Don't clear results if loading state is not ready,\n // because loading or error message can be removed.\n if (!state.index || !state.data)\n return;\n results.textContent = \"\";\n var searchText = query.value.trim();\n // Perform a wildcard search\n var res = state.index.search(\"*\" + searchText + \"*\");\n for (var i = 0, c = Math.min(10, res.length); i < c; i++) {\n var row = state.data.rows[Number(res[i].ref)];\n // Bold the matched part of the query in the search results\n var name_1 = boldMatches(row.name, searchText);\n if (row.parent) {\n name_1 = \"\" + boldMatches(row.parent, searchText) + \".\" + name_1;\n }\n var item = document.createElement(\"li\");\n item.classList.value = row.classes;\n var anchor = document.createElement(\"a\");\n anchor.href = state.base + row.url;\n anchor.classList.add(\"tsd-kind-icon\");\n anchor.innerHTML = name_1;\n item.append(anchor);\n results.appendChild(item);\n }\n}\n/**\n * Move the highlight within the result set.\n */\nfunction setCurrentResult(results, dir) {\n var current = results.querySelector(\".current\");\n if (!current) {\n current = results.querySelector(dir == 1 ? \"li:first-child\" : \"li:last-child\");\n if (current) {\n current.classList.add(\"current\");\n }\n }\n else {\n var rel = dir == 1\n ? current.nextElementSibling\n : current.previousElementSibling;\n if (rel) {\n current.classList.remove(\"current\");\n rel.classList.add(\"current\");\n }\n }\n}\n/**\n * Navigate to the highlighted result.\n */\nfunction gotoCurrentResult(results, field) {\n var current = results.querySelector(\".current\");\n if (!current) {\n current = results.querySelector(\"li:first-child\");\n }\n if (current) {\n var link = current.querySelector(\"a\");\n if (link) {\n window.location.href = link.href;\n }\n field.blur();\n }\n}\nfunction boldMatches(text, search) {\n if (search === \"\") {\n return text;\n }\n var lowerText = text.toLocaleLowerCase();\n var lowerSearch = search.toLocaleLowerCase();\n var parts = [];\n var lastIndex = 0;\n var index = lowerText.indexOf(lowerSearch);\n while (index != -1) {\n parts.push(escapeHtml(text.substring(lastIndex, index)), \"\" + escapeHtml(text.substring(index, index + lowerSearch.length)) + \"\");\n lastIndex = index + lowerSearch.length;\n index = lowerText.indexOf(lowerSearch, lastIndex);\n }\n parts.push(escapeHtml(text.substring(lastIndex)));\n return parts.join(\"\");\n}\nvar SPECIAL_HTML = {\n \"&\": \"&\",\n \"<\": \"<\",\n \">\": \">\",\n \"'\": \"'\",\n '\"': \""\",\n};\nfunction escapeHtml(text) {\n return text.replace(/[&<>\"'\"]/g, function (match) { return SPECIAL_HTML[match]; });\n}\n\n\n//# sourceURL=webpack:///./default/assets/js/src/typedoc/components/Search.ts?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"initSearch\": () => /* binding */ initSearch\n/* harmony export */ });\n/* harmony import */ var _utils_debounce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/debounce */ \"./default/assets/js/src/typedoc/utils/debounce.ts\");\n/* harmony import */ var lunr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lunr */ \"../node_modules/lunr/lunr.js\");\n/* harmony import */ var lunr__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lunr__WEBPACK_IMPORTED_MODULE_1__);\n\n\nfunction initSearch() {\n var searchEl = document.getElementById(\"tsd-search\");\n if (!searchEl)\n return;\n var searchScript = document.getElementById(\"search-script\");\n searchEl.classList.add(\"loading\");\n if (searchScript) {\n searchScript.addEventListener(\"error\", function () {\n searchEl.classList.remove(\"loading\");\n searchEl.classList.add(\"failure\");\n });\n searchScript.addEventListener(\"load\", function () {\n searchEl.classList.remove(\"loading\");\n searchEl.classList.add(\"ready\");\n });\n if (window.searchData) {\n searchEl.classList.remove(\"loading\");\n }\n }\n var field = document.querySelector(\"#tsd-search-field\");\n var results = document.querySelector(\".results\");\n if (!field || !results) {\n throw new Error(\"The input field or the result list wrapper was not found\");\n }\n var resultClicked = false;\n results.addEventListener(\"mousedown\", function () { return (resultClicked = true); });\n results.addEventListener(\"mouseup\", function () {\n resultClicked = false;\n searchEl.classList.remove(\"has-focus\");\n });\n field.addEventListener(\"focus\", function () { return searchEl.classList.add(\"has-focus\"); });\n field.addEventListener(\"blur\", function () {\n if (!resultClicked) {\n resultClicked = false;\n searchEl.classList.remove(\"has-focus\");\n }\n });\n var state = {\n base: searchEl.dataset.base + \"/\",\n };\n bindEvents(searchEl, results, field, state);\n}\nfunction bindEvents(searchEl, results, field, state) {\n field.addEventListener(\"input\", (0,_utils_debounce__WEBPACK_IMPORTED_MODULE_0__.debounce)(function () {\n updateResults(searchEl, results, field, state);\n }, 200));\n var preventPress = false;\n field.addEventListener(\"keydown\", function (e) {\n preventPress = true;\n if (e.key == \"Enter\") {\n gotoCurrentResult(results, field);\n }\n else if (e.key == \"Escape\") {\n field.blur();\n }\n else if (e.key == \"ArrowUp\") {\n setCurrentResult(results, -1);\n }\n else if (e.key === \"ArrowDown\") {\n setCurrentResult(results, 1);\n }\n else {\n preventPress = false;\n }\n });\n field.addEventListener(\"keypress\", function (e) {\n if (preventPress)\n e.preventDefault();\n });\n /**\n * Start searching by pressing slash.\n */\n document.body.addEventListener(\"keydown\", function (e) {\n if (e.altKey || e.ctrlKey || e.metaKey)\n return;\n if (!field.matches(\":focus\") && e.key === \"/\") {\n field.focus();\n e.preventDefault();\n }\n });\n}\nfunction checkIndex(state, searchEl) {\n if (state.index)\n return;\n if (window.searchData) {\n searchEl.classList.remove(\"loading\");\n searchEl.classList.add(\"ready\");\n state.data = window.searchData;\n state.index = lunr__WEBPACK_IMPORTED_MODULE_1__.Index.load(window.searchData.index);\n }\n}\nfunction updateResults(searchEl, results, query, state) {\n checkIndex(state, searchEl);\n // Don't clear results if loading state is not ready,\n // because loading or error message can be removed.\n if (!state.index || !state.data)\n return;\n results.textContent = \"\";\n var searchText = query.value.trim();\n // Perform a wildcard search\n var res = state.index.search(\"*\" + searchText + \"*\");\n for (var i = 0, c = Math.min(10, res.length); i < c; i++) {\n var row = state.data.rows[Number(res[i].ref)];\n // Bold the matched part of the query in the search results\n var name_1 = boldMatches(row.name, searchText);\n if (row.parent) {\n name_1 = \"\" + boldMatches(row.parent, searchText) + \".\" + name_1;\n }\n var item = document.createElement(\"li\");\n item.classList.value = row.classes;\n var anchor = document.createElement(\"a\");\n anchor.href = state.base + row.url;\n anchor.classList.add(\"tsd-kind-icon\");\n anchor.innerHTML = name_1;\n item.append(anchor);\n results.appendChild(item);\n }\n}\n/**\n * Move the highlight within the result set.\n */\nfunction setCurrentResult(results, dir) {\n var current = results.querySelector(\".current\");\n if (!current) {\n current = results.querySelector(dir == 1 ? \"li:first-child\" : \"li:last-child\");\n if (current) {\n current.classList.add(\"current\");\n }\n }\n else {\n var rel = dir == 1\n ? current.nextElementSibling\n : current.previousElementSibling;\n if (rel) {\n current.classList.remove(\"current\");\n rel.classList.add(\"current\");\n }\n }\n}\n/**\n * Navigate to the highlighted result.\n */\nfunction gotoCurrentResult(results, field) {\n var current = results.querySelector(\".current\");\n if (!current) {\n current = results.querySelector(\"li:first-child\");\n }\n if (current) {\n var link = current.querySelector(\"a\");\n if (link) {\n window.location.href = link.href;\n }\n field.blur();\n }\n}\nfunction boldMatches(text, search) {\n if (search === \"\") {\n return text;\n }\n var lowerText = text.toLocaleLowerCase();\n var lowerSearch = search.toLocaleLowerCase();\n var parts = [];\n var lastIndex = 0;\n var index = lowerText.indexOf(lowerSearch);\n while (index != -1) {\n parts.push(escapeHtml(text.substring(lastIndex, index)), \"\" + escapeHtml(text.substring(index, index + lowerSearch.length)) + \"\");\n lastIndex = index + lowerSearch.length;\n index = lowerText.indexOf(lowerSearch, lastIndex);\n }\n parts.push(escapeHtml(text.substring(lastIndex)));\n return parts.join(\"\");\n}\nvar SPECIAL_HTML = {\n \"&\": \"&\",\n \"<\": \"<\",\n \">\": \">\",\n \"'\": \"'\",\n '\"': \""\",\n};\nfunction escapeHtml(text) {\n return text.replace(/[&<>\"'\"]/g, function (match) { return SPECIAL_HTML[match]; });\n}\n\n\n//# sourceURL=webpack:///./default/assets/js/src/typedoc/components/Search.ts?"); /***/ }), diff --git a/docs/classes/srp.html b/docs/classes/srp.html index 9ae6fcb..7d6c386 100644 --- a/docs/classes/srp.html +++ b/docs/classes/srp.html @@ -124,7 +124,7 @@
params: { 1024: { N: BigInteger; N_length_bits: number; g: BigInteger; hash: string }; 1536: { N: BigInteger; N_length_bits: number; g: BigInteger; hash: string }; 2048: { N: BigInteger; N_length_bits: number; g: BigInteger; hash: string }; 3072: { N: BigInteger; N_length_bits: number; g: BigInteger; hash: string }; 4096: { N: BigInteger; N_length_bits: number; g: BigInteger; hash: string }; 6244: { N: BigInteger; N_length_bits: number; g: BigInteger; hash: string }; 8192: { N: BigInteger; N_length_bits: number; g: BigInteger; hash: string }; hap: { N: BigInteger; N_length_bits: number; g: BigInteger; hash: string } } = ...
@@ -282,7 +282,7 @@
  • @@ -336,7 +336,7 @@
  • @@ -355,7 +355,7 @@
  • @@ -380,7 +380,7 @@
  • diff --git a/docs/classes/srpclient.html b/docs/classes/srpclient.html index 5dcd674..15da58b 100644 --- a/docs/classes/srpclient.html +++ b/docs/classes/srpclient.html @@ -108,7 +108,7 @@
  • @@ -171,7 +171,7 @@
  • @@ -203,7 +203,7 @@
  • @@ -225,7 +225,7 @@
  • @@ -247,7 +247,7 @@
  • @@ -270,7 +270,7 @@
  • diff --git a/docs/classes/srpserver.html b/docs/classes/srpserver.html index 9c551d2..57b4a41 100644 --- a/docs/classes/srpserver.html +++ b/docs/classes/srpserver.html @@ -120,7 +120,7 @@
  • @@ -171,7 +171,7 @@
  • Parameters

    @@ -191,7 +191,7 @@
  • Parameters

    @@ -216,10 +216,10 @@

    Optional _K

    -
    _K: undefined | Buffer
    +
    _K: Buffer
    @@ -231,30 +231,30 @@

    Optional _M1

    -
    _M1: undefined | Buffer
    +
    _M1: Buffer

    Optional _M2

    -
    _M2: undefined | Buffer
    +
    _M2: Buffer

    Optional _S

    -
    _S: undefined | Buffer
    +
    _S: Buffer
    @@ -266,10 +266,10 @@

    Optional _u

    -
    _u: undefined | BigInteger
    +
    _u: BigInteger
    @@ -291,7 +291,7 @@
  • @@ -322,7 +322,7 @@
  • @@ -344,7 +344,7 @@
  • @@ -366,7 +366,7 @@
  • @@ -389,7 +389,7 @@
  • diff --git a/docs/index.html b/docs/index.html index 3cea901..c7f1510 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@
    -

    Project fast-srp-hap

    +

    fast-srp-hap

    @@ -67,7 +67,7 @@ Coverage Status

    Is a pure NodeJS implementation of the SRP6a protocol.

    It's a derived work of Jed Parson's node-srp and Tom Wu's jsbn.

    -

    Full documentation can be found here.

    +

    Full documentation can be found here.

    Creating the Verifier

    @@ -82,7 +82,7 @@ */ async function srp6a_create_user(I: string, P: string) { const salt = await SRP.genKey(32); - + return { // The salt is required for authenticating the user later salt, @@ -108,7 +108,7 @@ // If we have the plaintext password salt: await SRP.genKey(32), password: 'password', // Or a Buffer - + // If we have a saved verifier salt: Buffer.from('...'), verifier: Buffer.from('...'), @@ -117,7 +117,7 @@ // Generate a secret key const secret = await SRP.genKey(32); - const server = new SrpServer(SRP.params[3076], user, secret); // For Apple SRP use params.hap + const server = new SrpServer(SRP.params[3076], user, secret); // For Apple SRP use params.hap // ... })(); diff --git a/docs/interfaces/baseidentity.html b/docs/interfaces/baseidentity.html index 54cba5c..7a21095 100644 --- a/docs/interfaces/baseidentity.html +++ b/docs/interfaces/baseidentity.html @@ -95,7 +95,7 @@
    salt: Buffer
  • @@ -105,7 +105,7 @@
    username: string | Buffer
    diff --git a/docs/interfaces/srpparams.html b/docs/interfaces/srpparams.html index 9a1413e..126d4a5 100644 --- a/docs/interfaces/srpparams.html +++ b/docs/interfaces/srpparams.html @@ -97,7 +97,7 @@
    N: BigInteger
    @@ -107,7 +107,7 @@
    N_length_bits: number
    @@ -117,7 +117,7 @@
    g: BigInteger
    @@ -127,7 +127,7 @@
    hash: string
    diff --git a/docs/modules.html b/docs/modules.html index e45e718..20ab062 100644 --- a/docs/modules.html +++ b/docs/modules.html @@ -50,7 +50,7 @@
  • -

    Project fast-srp-hap

    +

    fast-srp-hap

    @@ -96,7 +96,7 @@
    GenKeyCallback: (err: Error | null, data: Buffer | null) => void
    @@ -130,7 +130,7 @@ @@ -140,7 +140,7 @@
    PasswordIdentity: BaseIdentity & { password: Buffer | string }
    @@ -150,7 +150,7 @@
    VerifierIdentity: BaseIdentity & { verifier: Buffer }