-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
915986d
commit e0e57f0
Showing
11 changed files
with
4,536 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# http://editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
charset = UTF-8 | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"extends": "plugin:@dazn/kopytko/recommended", | ||
"plugins": ["@dazn/kopytko"], | ||
"rules": { | ||
"@dazn/kopytko/dependencies-order": "error", | ||
"@dazn/kopytko/missing-trailing-comma": "error", | ||
"@dazn/kopytko/indent": ["error", 2], | ||
"@dazn/kopytko/no-print": "off", | ||
"@dazn/kopytko/no-stop": "error", | ||
"@dazn/kopytko/sub-to-function": "error", | ||
"@dazn/kopytko/function-no-return": "error", | ||
"@dazn/kopytko/no-uninitialized-variables": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Release | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: 'npm' | ||
- name: Semantic Release | ||
id: release | ||
uses: cycjimmy/semantic-release-action@v4 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
with: | ||
extra_plugins: | | ||
@semantic-release/changelog@6 | ||
@semantic-release/git@10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.DS_Store | ||
.env | ||
.idea/ | ||
.vscode/ | ||
|
||
dist/ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"baseManifest": "./node_modules/@dazn/kopytko-unit-testing-framework/manifest.js", | ||
"sourceDir": "./src", | ||
"pluginDefinitions": { | ||
"generate-tests": "./node_modules/@dazn/kopytko-unit-testing-framework/plugins/generate-tests" | ||
}, | ||
"plugins": ["kopytko-copy-external-dependencies", "generate-tests"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,45 @@ | ||
# murmurhash-roku | ||
|
||
BrightScript implementation of MurmurHash | ||
|
||
The implementation is based on the following definition: | ||
https://en.wikipedia.org/wiki/MurmurHash#Algorithm | ||
|
||
## Installation | ||
|
||
### with kopytko-packager | ||
|
||
When using [kopytko-packager](https://github.com/getndazn/kopytko-packager) you can simly define this package as a dependecy. | ||
|
||
`npm i murmurhash-roku` | ||
|
||
### without kopytko-packager | ||
|
||
Copy `MurmurHash.brs` file from this repository to your project. | ||
|
||
**Remember that it uses also the `getType` function from the `kopytko-utils`, [so copy it along with it](https://github.com/getndazn/kopytko-utils/blob/master/src/components/getType.brs), or create a similar one.** | ||
|
||
## Usage | ||
|
||
```brightscript | ||
' @import /components/libs/MurmurHash.brs from murmurhash-roku | ||
function get123Hash() as LongInteger | ||
return MurmurHash().v3("123", 1) | ||
end function | ||
``` | ||
|
||
## Documentation | ||
|
||
Currently, there is only one hash method - v3. | ||
It generates MurmurHash v3. | ||
As Brightscript has only 32 or 64 signed values (Integer and LongInteger) this supports only 32-bit generation. | ||
|
||
`MurmurHash().v3(key, seed)` | ||
|
||
params: | ||
|
||
- key - String or ByteArray to be hashed | ||
- seed - accepts LongInteger, but it can be also an Integer | ||
|
||
returns: (**LongInteger**) hashed value **LongInteger** value hash |
Oops, something went wrong.