Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

Allow window size and polynomial to be configured from javascript #24

Closed
wants to merge 1 commit into from

Conversation

dordille
Copy link

Output from running rabin against README.md matches current functionality

$ node cli.js README.md --bits=6 --min=48 --max=192
{"length":68,"offset":0,"hash":"8cad28d1ae7ac0a33835e8ca30689b398afdb267734b1c44a9be31cd66c45c0c"}
{"length":150,"offset":68,"hash":"7381821ede8bff4de27b1636fe291fb203e60f021a474b3bf391e49260b77f95"}
{"length":55,"offset":218,"hash":"9fc523565c3a933d856d092a9571ff7d67f9bd6c51e3424b69b89eecb3d9c78d"}
{"length":158,"offset":273,"hash":"1f8f6bebef3230f255b9c258705d1c7c878caa161cc9c86c195dddc76c0a55ad"}
{"length":102,"offset":431,"hash":"3f5afae0e03f766c33bbc5122e90443e9cc9f722242b39ce7d770d05395a010e"}
{"length":68,"offset":533,"hash":"543fe21de47fda30ec8d2af91d0d504a3fa3e4c9c722f78f1c57723445328e6d"}
{"length":99,"offset":601,"hash":"b05cc35af1a8de0dcf210e9763282333affb4457b1c2b49ab3063a547d180ac7"}
{"length":79,"offset":700,"hash":"edafe8c25a92783a55043025379b873d603df9cb9a455f3af8dc27887f82fe1b"}
{"length":192,"offset":779,"hash":"0dd693b678eec43ae253660e0fb2c8ebc33fcec58862ac26bc2ee29a7a8b0ef6"}
{"length":136,"offset":971,"hash":"21c487886cf9341cf95f506a6a5273a335d0c38caf8bde6c20692cd5f0fc8b9a"}
{"length":192,"offset":1107,"hash":"92ee17305e9805a7d8111ccacab15ee4437332dcf269b062be78a64827dc0a5b"}
{"length":120,"offset":1299,"hash":"396effe4cdde82629254b5d219bf1ae6df7a394d8b079792c960962dc1a5be02"}
{"length":146,"offset":1419,"hash":"95383b1065270bf02fcfb724d061fcea868fec0894b8e302d4aa1c0075f7c078"}
{"length":148,"offset":1565,"hash":"f942b69bb5b61d9e1bdd12a2b90ad5629b8e325fd8fd72294af0769dfdd9a3a3"}
{"length":70,"offset":1713,"hash":"a9045bc35908cdb4663b1a4164dde3c7709156fe6cb8de2e0c21b29a345545c3"}
{"length":192,"offset":1783,"hash":"a03ba1a785f5781df74f1a2b6617096b3e078411a739096cd93b40db01c4e0bf"}
{"length":71,"offset":1975,"hash":"649615201a692f453e14f4769810ebfda6e5d2565861ba59b28d4740c7c4e5c0"}
{"length":50,"offset":2046,"hash":"6cb9322be32793903def977bf0835929ebe1b7ed29e6cc469e43535ac2c5951f"}
{"length":138,"offset":2096,"hash":"b11f842b3c60eac5b3b61037da7224c4229a9bff6350bae278ed5211b59cb7e1"}
{"length":192,"offset":2234,"hash":"172d08b31b81c1fa9a0f1b52b6f120488e35071b2aadd3e8051c65be8e834989"}
{"length":63,"offset":2426,"hash":"1c7cabe0d90fbc1ef47e09f85a8076d90044a28d7ca1d84b3e2966c93372ffb2"}
average 118

With additional window and polynomial configuration

$ node cli.js README.md --bits=6 --min=48 --max=192 --window=16 --polynomial="3DF305DFB2A805"
{"length":64,"offset":0,"hash":"2945cf96718d3fefc416d6e8a75a866976408d1be99dadb080369cce1ad18534"}
{"length":192,"offset":64,"hash":"9b237bc8e4930b06a6d5ac1b0147a7cfd1f9b72f38e4f3de3e9d8c96ec3073da"}
{"length":107,"offset":256,"hash":"c160c8416f5af86dbfb9acf1c7341de704950ad4c5e2d7bc132a3e87d0627fad"}
{"length":114,"offset":363,"hash":"0269ac0a23e12b4e70e1cb431cf535e1b5b372609c0445392831770cd804fbfd"}
{"length":99,"offset":477,"hash":"f474560b36b2f42ddd300ae8994fa75c052517abc2818181780737a418dd1e94"}
{"length":155,"offset":576,"hash":"cf260bb01905eaa004769096fad20883354fefac94e10107eb6a101233153df1"}
{"length":74,"offset":731,"hash":"7247d27e7e1a7dbe8931edc4f33e7961f00ad544a077b2371ced1f722615b1af"}
{"length":143,"offset":805,"hash":"48d29e00b26db0fd4daf13611608f773f378c4c1124d3947720f6225fd300d10"}
{"length":181,"offset":948,"hash":"2062456c0f9b2ac94450fbb9350fdc8cdae23d9eacb13f74dba879501c9309d4"}
{"length":90,"offset":1129,"hash":"56318847d3d9c6d9ba80f1bc3ef0403646edde07770c340c36f0c7f50c304e3f"}
{"length":61,"offset":1219,"hash":"f7556362be5a18c2186d9c85594ed6f5d913c1bec9af9050d44a7f1d60e428ff"}
{"length":50,"offset":1280,"hash":"c4ed459e66bdb6b99c853e80979891d5d86c7607bbc0158ad8aa90171cd0e32e"}
{"length":192,"offset":1330,"hash":"a300dcd3103831a642c36690a9d30afdf4289c029001c308c56686b7998d6264"}
{"length":49,"offset":1522,"hash":"d87d1e10ffc9a7c313f13b49564c22152cb55f81d0ae161c7cc3af19b994219d"}
{"length":72,"offset":1571,"hash":"eb1673fa75013412558c655745b92b182e67699dbbbb50fc84fe2a1194741c73"}
{"length":58,"offset":1643,"hash":"5913a0aa370f6ac58c1aa955a79e90d7163eb3e62dacd86a3ff30f45f9ff1678"}
{"length":84,"offset":1701,"hash":"2f58eb61498ed4d798d1193ecbe2a6c9390663be1b5aef7e63f3c3a39b66509a"}
{"length":111,"offset":1785,"hash":"769ee7712c48161eecb1f8e0efc7bf16e06ff7d769796e37f9fc2760bf633b4e"}
{"length":110,"offset":1896,"hash":"a03c5f4277ac72b35bd97297b867ce8492bc4eaae11dc781e923c6419ec84adb"}
{"length":112,"offset":2006,"hash":"c9975ead20262c78d8b21c8b0a2c799b0d9798feb80f5600e5e92c8c0717a493"}
{"length":79,"offset":2118,"hash":"e6f86ea8732384b09f5804d8735049637a4cdabc5a5ff826b488f17f0fd1301c"}
{"length":95,"offset":2197,"hash":"c1c982f8899a16531a7fee8c883f6e495e121ce60ea8b074b942cf97f37d3d05"}
{"length":62,"offset":2292,"hash":"fb3861ceab8ca5fab51212c260a4fb39988c1641f5eea204259b362b7685f819"}
{"length":96,"offset":2354,"hash":"8f44bd01ee58516b15a48cfe1b9d6258dd0ad16a4c84ee65f0e584ba06b43186"}
{"length":39,"offset":2450,"hash":"7aa4e1844e5206b013afdbf207e9272622567ea6bc438f4d76bb2ab6b64e242b"}```

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant