Initial Commit resolving issues from Snack-X/md6
This commit is contained in:
1 parent
9a94a59b4b
commit
5fa1e853d3
13 files changed
+776
-849
No files matched your search
Generated
+69
@@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="MarkdownProjectSettings">
|
||||
<PreviewSettings splitEditorLayout="FIRST" splitEditorPreview="PREVIEW" useGrayscaleRendering="false" zoomFactor="1.0" maxImageWidth="0" showGitHubPageIfSynced="false" allowBrowsingInPreview="false" synchronizePreviewPosition="false" highlightPreviewType="LINE" highlightFadeOut="5" highlightOnTyping="false" synchronizeSourcePosition="false">
|
||||
<PanelProvider>
|
||||
<provider providerId="com.vladsch.idea.multimarkdown.editor.javafx.html.panel" providerName="JavaFX WebView" />
|
||||
</PanelProvider>
|
||||
</PreviewSettings>
|
||||
<ParserSettings>
|
||||
<PegdownExtensions>
|
||||
<option name="ABBREVIATIONS" value="false" />
|
||||
<option name="ANCHORLINKS" value="true" />
|
||||
<option name="ATXHEADERSPACE" value="false" />
|
||||
<option name="AUTOLINKS" value="true" />
|
||||
<option name="DEFINITIONS" value="true" />
|
||||
<option name="FENCED_CODE_BLOCKS" value="true" />
|
||||
<option name="FOOTNOTES" value="false" />
|
||||
<option name="HARDWRAPS" value="true" />
|
||||
<option name="INSERTED" value="false" />
|
||||
<option name="QUOTES" value="false" />
|
||||
<option name="RELAXEDHRULES" value="true" />
|
||||
<option name="SMARTS" value="false" />
|
||||
<option name="STRIKETHROUGH" value="true" />
|
||||
<option name="SUBSCRIPT" value="false" />
|
||||
<option name="SUPERSCRIPT" value="false" />
|
||||
<option name="SUPPRESS_HTML_BLOCKS" value="false" />
|
||||
<option name="SUPPRESS_INLINE_HTML" value="false" />
|
||||
<option name="TABLES" value="true" />
|
||||
<option name="TASKLISTITEMS" value="true" />
|
||||
<option name="TOC" value="false" />
|
||||
<option name="WIKILINKS" value="true" />
|
||||
</PegdownExtensions>
|
||||
<ParserOptions>
|
||||
<option name="COMMONMARK_LISTS" value="false" />
|
||||
<option name="DUMMY" value="false" />
|
||||
<option name="EMOJI_SHORTCUTS" value="true" />
|
||||
<option name="FLEXMARK_FRONT_MATTER" value="false" />
|
||||
<option name="GFM_LOOSE_BLANK_LINE_AFTER_ITEM_PARA" value="false" />
|
||||
<option name="GFM_TABLE_RENDERING" value="true" />
|
||||
<option name="GITBOOK_URL_ENCODING" value="false" />
|
||||
<option name="GITHUB_EMOJI_URL" value="false" />
|
||||
<option name="GITHUB_LISTS" value="false" />
|
||||
<option name="GITHUB_WIKI_LINKS" value="true" />
|
||||
<option name="JEKYLL_FRONT_MATTER" value="false" />
|
||||
<option name="SIM_TOC_BLANK_LINE_SPACER" value="false" />
|
||||
</ParserOptions>
|
||||
</ParserSettings>
|
||||
<HtmlSettings headerTopEnabled="false" headerBottomEnabled="false" bodyTopEnabled="false" bodyBottomEnabled="false" embedUrlContent="false" addPageHeader="true">
|
||||
<GeneratorProvider>
|
||||
<provider providerId="com.vladsch.idea.multimarkdown.editor.javafx.html.generator" providerName="JavaFx HTML Generator" />
|
||||
</GeneratorProvider>
|
||||
<headerTop />
|
||||
<headerBottom />
|
||||
<bodyTop />
|
||||
<bodyBottom />
|
||||
</HtmlSettings>
|
||||
<CssSettings previewScheme="UI_SCHEME" cssUri="" isCssUriEnabled="false" isCssTextEnabled="false" isDynamicPageWidth="true">
|
||||
<StylesheetProvider>
|
||||
<provider providerId="com.vladsch.idea.multimarkdown.editor.javafx.html.css" providerName="Default JavaFx Stylesheet" />
|
||||
</StylesheetProvider>
|
||||
<ScriptProviders />
|
||||
<cssText />
|
||||
</CssSettings>
|
||||
<HtmlExportSettings updateOnSave="false" parentDir="$ProjectFileDir$" targetDir="$ProjectFileDir$" cssDir="" scriptDir="" plainHtml="false" imageDir="" copyLinkedImages="false" imageUniquifyType="0" targetExt="" useTargetExt="false" noCssNoScripts="false" linkToExportedHtml="true" exportOnSettingsChange="true" regenerateOnProjectOpen="false" />
|
||||
<LinkMapSettings>
|
||||
<textMaps />
|
||||
</LinkMapSettings>
|
||||
</component>
|
||||
</project>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<component name="MarkdownNavigator.ProfileManager">
|
||||
<settings default="" pdf-export="" />
|
||||
</component>
|
||||
Generated
+12
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
Generated
+8
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/md6.iml" filepath="$PROJECT_DIR$/.idea/md6.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
Generated
+6
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
Generated
+335
@@ -0,0 +1,335 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="caa27e6c-bce2-4d70-ad91-a3faf8d6a444" name="Default" comment="">
|
||||
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/markdown-navigator.xml" />
|
||||
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/markdown-navigator/profiles_settings.xml" />
|
||||
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/md6.iml" />
|
||||
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/modules.xml" />
|
||||
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/vcs.xml" />
|
||||
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
|
||||
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/package.json" />
|
||||
<change type="DELETED" beforePath="$PROJECT_DIR$/md6.php" afterPath="" />
|
||||
<change type="DELETED" beforePath="$PROJECT_DIR$/md6.py" afterPath="" />
|
||||
<change type="DELETED" beforePath="$PROJECT_DIR$/test/test.php" afterPath="" />
|
||||
<change type="DELETED" beforePath="$PROJECT_DIR$/test/test.py" afterPath="" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/README.md" afterPath="$PROJECT_DIR$/README.md" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/md6.js" afterPath="$PROJECT_DIR$/md6.js" />
|
||||
</list>
|
||||
<ignored path="$PROJECT_DIR$/.tmp/" />
|
||||
<ignored path="$PROJECT_DIR$/temp/" />
|
||||
<ignored path="$PROJECT_DIR$/tmp/" />
|
||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||
<option name="TRACKING_ENABLED" value="true" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
|
||||
<component name="FileEditorManager">
|
||||
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
|
||||
<file leaf-file-name="README.md" pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/README.md">
|
||||
<provider selected="true" editor-type-id="split-provider[text-editor;MarkdownPreviewEditor]">
|
||||
<state split_layout="FIRST">
|
||||
<first_editor relative-caret-position="30">
|
||||
<caret line="2" column="23" lean-forward="false" selection-start-line="2" selection-start-column="23" selection-end-line="2" selection-end-column="23" />
|
||||
<folding />
|
||||
</first_editor>
|
||||
<second_editor>
|
||||
<js_state />
|
||||
</second_editor>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="package.json" pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/package.json">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="90">
|
||||
<caret line="6" column="12" lean-forward="false" selection-start-line="6" selection-start-column="12" selection-end-line="6" selection-end-column="12" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="md6.js" pinned="false" current-in-tab="true">
|
||||
<entry file="file://$PROJECT_DIR$/md6.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="15">
|
||||
<caret line="1" column="26" lean-forward="false" selection-start-line="1" selection-start-column="26" selection-end-line="1" selection-end-column="26" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
</leaf>
|
||||
</component>
|
||||
<component name="FindInProjectRecents">
|
||||
<findStrings>
|
||||
<find>left</find>
|
||||
<find>\t</find>
|
||||
<find>for \((.+) in</find>
|
||||
</findStrings>
|
||||
<replaceStrings>
|
||||
<replace />
|
||||
<replace />
|
||||
</replaceStrings>
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="IdeDocumentHistory">
|
||||
<option name="CHANGED_PATHS">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/README.md" />
|
||||
<option value="$PROJECT_DIR$/package.json" />
|
||||
<option value="$PROJECT_DIR$/md6.js" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
|
||||
<component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
|
||||
<component name="JsGulpfileManager">
|
||||
<detection-done>true</detection-done>
|
||||
<sorting>DEFINITION_ORDER</sorting>
|
||||
</component>
|
||||
<component name="ProjectFrameBounds">
|
||||
<option name="y" value="23" />
|
||||
<option name="width" value="1920" />
|
||||
<option name="height" value="971" />
|
||||
</component>
|
||||
<component name="ProjectView">
|
||||
<navigator currentView="ProjectPane" proportions="" version="1">
|
||||
<flattenPackages />
|
||||
<showMembers />
|
||||
<showModules />
|
||||
<showLibraryContents />
|
||||
<hideEmptyPackages />
|
||||
<abbreviatePackageNames />
|
||||
<autoscrollToSource />
|
||||
<autoscrollFromSource />
|
||||
<sortByType />
|
||||
<manualOrder />
|
||||
<foldersAlwaysOnTop value="true" />
|
||||
</navigator>
|
||||
<panes>
|
||||
<pane id="Scope" />
|
||||
<pane id="ProjectPane">
|
||||
<subPane>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="md6" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="md6" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
</subPane>
|
||||
</pane>
|
||||
<pane id="Scratches" />
|
||||
</panes>
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="nodejs_interpreter_path" value="/usr/local/bin/node" />
|
||||
<property name="WebServerToolWindowFactoryState" value="false" />
|
||||
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
|
||||
<property name="settings.editor.selected.configurable" value="preferences.sourceCode.JavaScript" />
|
||||
</component>
|
||||
<component name="RunDashboard">
|
||||
<option name="ruleStates">
|
||||
<list>
|
||||
<RuleState>
|
||||
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
|
||||
</RuleState>
|
||||
<RuleState>
|
||||
<option name="name" value="StatusDashboardGroupingRule" />
|
||||
</RuleState>
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="RunManager">
|
||||
<configuration default="true" type="DartCommandLineRunConfigurationType" factoryName="Dart Command Line Application">
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="DartTestRunConfigurationType" factoryName="Dart Test">
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="JavaScriptTestRunnerJest" factoryName="Jest">
|
||||
<node-interpreter value="project" />
|
||||
<working-dir value="" />
|
||||
<envs />
|
||||
<scope-kind value="ALL" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="JavaScriptTestRunnerKarma" factoryName="Karma">
|
||||
<config-file value="" />
|
||||
<node-interpreter value="project" />
|
||||
<envs />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="JavaScriptTestRunnerProtractor" factoryName="Protractor">
|
||||
<config-file value="" />
|
||||
<node-interpreter value="project" />
|
||||
<envs />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="NodeJSConfigurationType" factoryName="Node.js" path-to-node="project" working-dir="">
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="cucumber.js" factoryName="Cucumber.js">
|
||||
<option name="cucumberJsArguments" value="" />
|
||||
<option name="executablePath" />
|
||||
<option name="filePath" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
|
||||
<node-interpreter>project</node-interpreter>
|
||||
<node-options />
|
||||
<gulpfile />
|
||||
<tasks />
|
||||
<arguments />
|
||||
<envs />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="js.build_tools.npm" factoryName="npm">
|
||||
<command value="run" />
|
||||
<scripts />
|
||||
<node-interpreter value="project" />
|
||||
<envs />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="mocha-javascript-test-runner" factoryName="Mocha">
|
||||
<node-interpreter>project</node-interpreter>
|
||||
<node-options />
|
||||
<working-directory />
|
||||
<pass-parent-env>true</pass-parent-env>
|
||||
<envs />
|
||||
<ui />
|
||||
<extra-mocha-options />
|
||||
<test-kind>DIRECTORY</test-kind>
|
||||
<test-directory />
|
||||
<recursive>false</recursive>
|
||||
<method />
|
||||
</configuration>
|
||||
</component>
|
||||
<component name="ShelveChangesManager" show_recycled="false">
|
||||
<option name="remove_strategy" value="false" />
|
||||
</component>
|
||||
<component name="SvnConfiguration">
|
||||
<configuration />
|
||||
</component>
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="caa27e6c-bce2-4d70-ad91-a3faf8d6a444" name="Default" comment="" />
|
||||
<created>1492038754719</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1492038754719</updated>
|
||||
<workItem from="1492038755994" duration="1310000" />
|
||||
<workItem from="1492104777549" duration="2276000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TimeTrackingManager">
|
||||
<option name="totallyTimeSpent" value="3586000" />
|
||||
</component>
|
||||
<component name="ToolWindowManager">
|
||||
<frame x="0" y="23" width="1920" height="971" extended-state="6" />
|
||||
<editor active="true" />
|
||||
<layout>
|
||||
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24960506" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
|
||||
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
|
||||
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32992035" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
|
||||
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
|
||||
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
</layout>
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
<option name="processedProjectFiles" value="true" />
|
||||
</component>
|
||||
<component name="VcsContentAnnotationSettings">
|
||||
<option name="myLimit" value="2678400000" />
|
||||
</component>
|
||||
<component name="XDebuggerManager">
|
||||
<breakpoint-manager />
|
||||
<watches-manager />
|
||||
</component>
|
||||
<component name="editorHistoryManager">
|
||||
<entry file="file://$PROJECT_DIR$/README.md">
|
||||
<provider selected="true" editor-type-id="split-provider[text-editor;MarkdownPreviewEditor]">
|
||||
<state split_layout="FIRST">
|
||||
<first_editor relative-caret-position="30">
|
||||
<caret line="2" column="23" lean-forward="true" selection-start-line="2" selection-start-column="23" selection-end-line="2" selection-end-column="23" />
|
||||
<folding />
|
||||
</first_editor>
|
||||
<second_editor>
|
||||
<js_state />
|
||||
</second_editor>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/package.json">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="90">
|
||||
<caret line="6" column="12" lean-forward="false" selection-start-line="6" selection-start-column="12" selection-end-line="6" selection-end-column="12" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/md6.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="3105">
|
||||
<caret line="207" column="44" lean-forward="true" selection-start-line="207" selection-start-column="44" selection-end-line="207" selection-end-column="44" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/README.md">
|
||||
<provider selected="true" editor-type-id="split-provider[text-editor;MarkdownPreviewEditor]">
|
||||
<state split_layout="FIRST">
|
||||
<first_editor relative-caret-position="30">
|
||||
<caret line="2" column="23" lean-forward="false" selection-start-line="2" selection-start-column="23" selection-end-line="2" selection-end-column="23" />
|
||||
<folding />
|
||||
</first_editor>
|
||||
<second_editor>
|
||||
<js_state />
|
||||
</second_editor>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/package.json">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="90">
|
||||
<caret line="6" column="12" lean-forward="false" selection-start-line="6" selection-start-column="12" selection-end-line="6" selection-end-column="12" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/md6.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="15">
|
||||
<caret line="1" column="26" lean-forward="false" selection-start-line="1" selection-start-column="26" selection-end-line="1" selection-end-column="26" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,25 +1,14 @@
|
||||
# md6
|
||||
|
||||
md6 FTW
|
||||
Forked from Snack-X/md6
|
||||
|
||||
## Supports
|
||||
|
||||
* php
|
||||
* Node.js
|
||||
* javascript
|
||||
|
||||
## LICENSE
|
||||
To the extent possible under law, [Amrit Panesar](https://github.com/Neo-Desktop) has waived all copyright
|
||||
and related or neighboring rights to [node-md6](https://github.com/Neo-Desktop/md6#).
|
||||
|
||||
```
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
Version 2, December 2004
|
||||
|
||||
Copyright (C) 2014 Snack
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim or modified
|
||||
copies of this license document, and changing it is allowed as long
|
||||
as the name is changed.
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. You just DO WHAT THE FUCK YOU WANT TO.
|
||||
```
|
||||
This work is published from: United States.
|
||||
@@ -1,7 +1,10 @@
|
||||
/**
|
||||
*
|
||||
* md6hash for Javascript
|
||||
*
|
||||
* Authors: Amrit Panesar [Neo-Desktop]
|
||||
* Snack-X
|
||||
* cuixiping
|
||||
*
|
||||
* Usage :
|
||||
* var md6 = new md6hash();
|
||||
* var data = "md6 FTW";
|
||||
@@ -9,307 +12,324 @@
|
||||
* console.log(result); // 7bfaa624f661a683be2a3b2007493006a30a7845ee1670e499927861a8e74cce
|
||||
*
|
||||
* For node.js:
|
||||
* var md6hash = require("./md6").md6hash;
|
||||
* var md6hash = require("node-md6");
|
||||
* var md6 = new md6hash();
|
||||
*
|
||||
*/
|
||||
var md6hash = function() {
|
||||
function to_word(input) {
|
||||
var i, length = input.length, output = [];
|
||||
|
||||
for(i = 0; i < length; i += 8) {
|
||||
output.push([
|
||||
((input[i + 0] & 0xff) << 24) |
|
||||
((input[i + 1] & 0xff) << 16) |
|
||||
((input[i + 2] & 0xff) << 8) |
|
||||
((input[i + 3] & 0xff) << 0),
|
||||
((input[i + 4] & 0xff) << 24) |
|
||||
((input[i + 5] & 0xff) << 16) |
|
||||
((input[i + 6] & 0xff) << 8) |
|
||||
((input[i + 7] & 0xff) << 0)
|
||||
]);
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
function from_word(input) {
|
||||
var i, length = input.length, output = [];
|
||||
|
||||
for(i = 0 ; i < length ; i += 1) {
|
||||
output.push((input[i][0] >> 24) & 0xff);
|
||||
output.push((input[i][0] >> 16) & 0xff);
|
||||
output.push((input[i][0] >> 8) & 0xff);
|
||||
output.push((input[i][0] >> 0) & 0xff);
|
||||
output.push((input[i][1] >> 24) & 0xff);
|
||||
output.push((input[i][1] >> 16) & 0xff);
|
||||
output.push((input[i][1] >> 8) & 0xff);
|
||||
output.push((input[i][1] >> 0) & 0xff);
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
function _xor(x, y) {
|
||||
return [x[0] ^ y[0], x[1] ^ y[1]];
|
||||
}
|
||||
|
||||
function _and(x, y) {
|
||||
return [x[0] & y[0], x[1] & y[1]];
|
||||
}
|
||||
|
||||
function _shl(x, n) {
|
||||
var a = x[0] | 0x0, b = x[1] | 0x0;
|
||||
|
||||
if(n >= 32) {
|
||||
return [(b << (n - 32)), 0x0];
|
||||
}
|
||||
else {
|
||||
return [((a << n) | (b >>> (32 - n))), (b << n)];
|
||||
}
|
||||
}
|
||||
|
||||
function _shr(x, n) {
|
||||
var a = x[0] | 0x0, b = x[1] | 0x0;
|
||||
|
||||
if(n >= 32) {
|
||||
return [0x0, (a >>> (n - 32))];
|
||||
}
|
||||
else {
|
||||
return [(a >>> n), ((a << (32 - n)) | (b >>> n))];
|
||||
}
|
||||
}
|
||||
|
||||
function crop(size, hash, right) {
|
||||
var length = Math.floor((size + 7) / 8), remain = size % 8;
|
||||
|
||||
if(right) {
|
||||
hash = hash.slice(hash.length - length);
|
||||
}
|
||||
else {
|
||||
hash = hash.slice(0, length);
|
||||
}
|
||||
|
||||
if(remain > 0) {
|
||||
hash[length - 1] &= (0xff << (8 - remain)) & 0xff;
|
||||
}
|
||||
|
||||
return hash;
|
||||
}
|
||||
var md6hash = function () {
|
||||
function to_word(input) {
|
||||
var i, length = input.length, output = [];
|
||||
|
||||
function _hash(size, data, key, levels) {
|
||||
var b, c, n, d, M, K, k, r, L, ell, S0, Sm, Q, t, rs, ls;
|
||||
|
||||
b = 512;
|
||||
c = 128;
|
||||
|
||||
n = 89;
|
||||
|
||||
d = size;
|
||||
M = data;
|
||||
|
||||
K = key.slice(0, 64);
|
||||
k = K.length;
|
||||
|
||||
while (K.length < 64) {
|
||||
K.push(0x00);
|
||||
}
|
||||
|
||||
K = to_word(K);
|
||||
|
||||
r = Math.max((k ? 80 : 0), (40 + (d / 4)));
|
||||
|
||||
L = levels;
|
||||
ell = 0;
|
||||
|
||||
S0 = [0x01234567, 0x89abcdef];
|
||||
Sm = [0x7311c281, 0x2425cfa0];
|
||||
|
||||
Q = [
|
||||
[0x7311c281, 0x2425cfa0], [0x64322864, 0x34aac8e7], [0xb60450e9, 0xef68b7c1],
|
||||
[0xe8fb2390, 0x8d9f06f1], [0xdd2e76cb, 0xa691e5bf], [0x0cd0d63b, 0x2c30bc41],
|
||||
[0x1f8ccf68, 0x23058f8a], [0x54e5ed5b, 0x88e3775d], [0x4ad12aae, 0x0a6d6031],
|
||||
[0x3e7f16bb, 0x88222e0d], [0x8af8671d, 0x3fb50c2c], [0x995ad117, 0x8bd25c31],
|
||||
[0xc878c1dd, 0x04c4b633], [0x3b72066c, 0x7a1552ac], [0x0d6f3522, 0x631effcb]
|
||||
];
|
||||
|
||||
t = [17, 18, 21, 31, 67, 89];
|
||||
rs = [10, 5, 13, 10, 11, 12, 2, 7, 14, 15, 7, 13, 11, 7, 6, 12];
|
||||
ls = [11, 24, 9, 16, 15, 9, 27, 15, 6, 2, 29, 8, 15, 5, 31, 9];
|
||||
|
||||
function f(N) {
|
||||
var i, j, s, x, S = [].concat(S0), A = [].concat(N);
|
||||
|
||||
for(j = 0, i = n ; j < r ; j += 1, i += 16) {
|
||||
for(s = 0 ; s < 16 ; s += 1) {
|
||||
x = [].concat(S);
|
||||
x = _xor(x, A[i + s - t[5]]);
|
||||
x = _xor(x, A[i + s - t[0]]);
|
||||
x = _xor(x, _and(A[i + s - t[1]], A[i + s - t[2]]));
|
||||
x = _xor(x, _and(A[i + s - t[3]], A[i + s - t[4]]));
|
||||
x = _xor(x, _shr(x, rs[s]));
|
||||
A[i + s] = _xor(x, _shl(x, ls[s]));
|
||||
}
|
||||
|
||||
S = _xor(_xor(_shl(S, 1), _shr(S, (64 - 1))), _and(S, Sm));
|
||||
}
|
||||
|
||||
return A.slice(A.length - 16);
|
||||
}
|
||||
|
||||
function mid(B, C, i, p, z) {
|
||||
var U, V;
|
||||
|
||||
U = [
|
||||
((ell & 0xff) << 24) | ((i / Math.pow(2, 32)) & 0xffffff),
|
||||
i & 0xffffffff
|
||||
];
|
||||
|
||||
V = [
|
||||
((r & 0xfff) << 16) | ((L & 0xff) << 8) | ((z & 0xf) << 4) | ((p & 0xf000) >> 12),
|
||||
(((p & 0xfff) << 20) | ((k & 0xff) << 12) | ((d & 0xfff)))
|
||||
];
|
||||
|
||||
return f([].concat(Q, K, [U, V], C, B));
|
||||
}
|
||||
|
||||
function par(M) {
|
||||
var i, l, p, z, P = 0, B = [], C = [];
|
||||
z = (M.length > b ? 0 : 1);
|
||||
|
||||
while((M.length < 1) || ((M.length % b) > 0)) {
|
||||
M.push(0x00);
|
||||
P += 8;
|
||||
}
|
||||
for (i = 0; i < length; i += 8) {
|
||||
output.push([
|
||||
((input[i] & 0xff) << 24) | ((input[i + 1] & 0xff) << 16) |
|
||||
((input[i + 2] & 0xff) << 8) | ((input[i + 3] & 0xff) << 0),
|
||||
|
||||
M = to_word(M);
|
||||
|
||||
while(M.length > 0) {
|
||||
B.push(M.slice(0, (b / 8)));
|
||||
M = M.slice(b / 8);
|
||||
}
|
||||
|
||||
for(i = 0, p = 0, l = B.length ; i < l ; i += 1, p = 0) {
|
||||
p = (i === (B.length - 1)) ? P : 0;
|
||||
C = C.concat(mid(B[i], [], i, p, z));
|
||||
}
|
||||
|
||||
return from_word(C);
|
||||
}
|
||||
|
||||
function seq(M) {
|
||||
var i, l, p, z, P = 0, B = [], C = [
|
||||
[0x0, 0x0], [0x0, 0x0], [0x0, 0x0], [0x0, 0x0],
|
||||
[0x0, 0x0], [0x0, 0x0], [0x0, 0x0], [0x0, 0x0],
|
||||
[0x0, 0x0], [0x0, 0x0], [0x0, 0x0], [0x0, 0x0],
|
||||
[0x0, 0x0], [0x0, 0x0], [0x0, 0x0], [0x0, 0x0]
|
||||
];
|
||||
|
||||
while((M.length < 1) || ((M.length % (b - c)) > 0)) {
|
||||
M.push(0x00);
|
||||
P += 8;
|
||||
}
|
||||
((input[i + 4] & 0xff) << 24) | ((input[i + 5] & 0xff) << 16) |
|
||||
((input[i + 6] & 0xff) << 8) | ((input[i + 7] & 0xff) << 0)
|
||||
]);
|
||||
}
|
||||
|
||||
M = to_word(M);
|
||||
|
||||
while(M.length > 0) {
|
||||
B.push(M.slice(0, ((b - c) / 8)));
|
||||
M = M.slice((b - c) / 8);
|
||||
}
|
||||
|
||||
for(i = 0, p = 0, l = B.length ; i < l ; i += 1, p = 0) {
|
||||
p = (i === (B.length - 1)) ? P : 0;
|
||||
z = (i === (B.length - 1)) ? 1 : 0;
|
||||
C = mid(B[i], C, i, p, z);
|
||||
}
|
||||
|
||||
return from_word(C);
|
||||
}
|
||||
|
||||
do {
|
||||
ell += 1;
|
||||
return output;
|
||||
}
|
||||
|
||||
M = ell > L ? seq(M) : par(M);
|
||||
} while(M.length !== c);
|
||||
|
||||
return crop(d, M, true);
|
||||
}
|
||||
function from_word(input) {
|
||||
var i, length = input.length, output = [];
|
||||
|
||||
function bytes(input) {
|
||||
var output = [], i, ch;
|
||||
for (i = 0; i < length; i += 1) {
|
||||
output.push((input[i][0] >> 24) & 0xff);
|
||||
output.push((input[i][0] >> 16) & 0xff);
|
||||
output.push((input[i][0] >> 8) & 0xff);
|
||||
output.push((input[i][0] >> 0) & 0xff);
|
||||
output.push((input[i][1] >> 24) & 0xff);
|
||||
output.push((input[i][1] >> 16) & 0xff);
|
||||
output.push((input[i][1] >> 8) & 0xff);
|
||||
output.push((input[i][1] >> 0) & 0xff);
|
||||
}
|
||||
|
||||
for(i = 0 ; i < input.length ; i++) {
|
||||
ch = input.charCodeAt(i);
|
||||
if(ch <= 0x7f) {
|
||||
output.push(ch);
|
||||
}
|
||||
else if(ch <= 0x7ff) {
|
||||
output.push((ch >> 6) | 0xc0);
|
||||
output.push((ch & 0x3F) | 0x80);
|
||||
}
|
||||
else if(ch <= 0xffff) {
|
||||
output.push((ch >> 12) | 0xe0);
|
||||
output.push(((ch >> 6) & 0x3f) | 0x80);
|
||||
output.push((ch & 0x3f) | 0x80);
|
||||
}
|
||||
else {
|
||||
output.push((ch >> 18) | 0xf0);
|
||||
output.push(((ch >> 12) & 0x3f) | 0x80);
|
||||
output.push(((ch >> 6) & 0x3f) | 0x80);
|
||||
output.push((ch & 0x3f) | 0x80);
|
||||
}
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
function _xor(x, y) {
|
||||
return [
|
||||
x[0] ^ y[0],
|
||||
x[1] ^ y[1]
|
||||
];
|
||||
}
|
||||
|
||||
function _prehash(data, size, key, levels) {
|
||||
if(typeof data === "undefined") data = "";
|
||||
if(typeof size === "undefined") size = 256;
|
||||
if(typeof key === "undefined") key = "";
|
||||
if(typeof levels === "undefined") levels = 64;
|
||||
function _and(x, y) {
|
||||
return [
|
||||
x[0] & y[0],
|
||||
x[1] & y[1]
|
||||
];
|
||||
}
|
||||
|
||||
data = bytes(data);
|
||||
key = bytes(key);
|
||||
function _shl(x, n) {
|
||||
var a = x[0] | 0x0,
|
||||
b = x[1] | 0x0;
|
||||
|
||||
if(size <= 0) size = 1;
|
||||
else if(size > 512) size = 512;
|
||||
if (n >= 32) {
|
||||
return [
|
||||
(b << (n - 32)),
|
||||
0x0
|
||||
];
|
||||
}
|
||||
else {
|
||||
return [
|
||||
((a << n) | (b >>> (32 - n))),
|
||||
(b << n)
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
return _hash(size, data, key, levels);
|
||||
}
|
||||
function _shr(x, n) {
|
||||
var a = x[0] | 0x0,
|
||||
b = x[1] | 0x0;
|
||||
|
||||
function _hex(data, size, key, levels) {
|
||||
var hash = _prehash(data, size, key, levels);
|
||||
var hex = "";
|
||||
var i;
|
||||
if (n >= 32) {
|
||||
return [
|
||||
0x0,
|
||||
(a >>> (n - 32))
|
||||
];
|
||||
}
|
||||
else {
|
||||
return [
|
||||
(a >>> n),
|
||||
((a << (32 - n)) | (b >>> n))
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
for(i in hash) {
|
||||
var v = hash[i];
|
||||
var x = v.toString(16);
|
||||
if(x.length === 1) x = "0" + x;
|
||||
hex += x;
|
||||
}
|
||||
function crop(size, hash, right) {
|
||||
var length = Math.floor((size + 7) / 8),
|
||||
remain = size % 8;
|
||||
|
||||
return hex;
|
||||
}
|
||||
if (right) {
|
||||
hash = hash.slice(hash.length - length);
|
||||
}
|
||||
else {
|
||||
hash = hash.slice(0, length);
|
||||
}
|
||||
|
||||
function _raw(data, size, key, levels) {
|
||||
var hash = _prehash(data, size, key, levels);
|
||||
var raw = "";
|
||||
var i;
|
||||
if (remain > 0) {
|
||||
hash[length - 1] &= (0xff << (8 - remain)) & 0xff;
|
||||
}
|
||||
|
||||
for(i in hash) {
|
||||
var v = hash[i];
|
||||
raw += String.fromCharCode(v);
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
return raw;
|
||||
}
|
||||
function _hash(size, data, key, levels) {
|
||||
var b, c, n, d, M, K, k, r, L, ell, S0, Sm, Q, t, rs, ls;
|
||||
|
||||
return {
|
||||
hex: _hex,
|
||||
raw: _raw
|
||||
};
|
||||
b = 512;
|
||||
c = 128;
|
||||
|
||||
n = 89;
|
||||
|
||||
d = size;
|
||||
M = data;
|
||||
|
||||
K = key.slice(0, 64);
|
||||
k = K.length;
|
||||
|
||||
while (K.length < 64) {
|
||||
K.push(0x00);
|
||||
}
|
||||
|
||||
K = to_word(K);
|
||||
|
||||
r = Math.max((k ? 80 : 0), (40 + (d / 4)));
|
||||
|
||||
L = levels;
|
||||
ell = 0;
|
||||
|
||||
S0 = [0x01234567, 0x89abcdef];
|
||||
Sm = [0x7311c281, 0x2425cfa0];
|
||||
|
||||
Q = [
|
||||
[0x7311c281, 0x2425cfa0], [0x64322864, 0x34aac8e7], [0xb60450e9, 0xef68b7c1],
|
||||
[0xe8fb2390, 0x8d9f06f1], [0xdd2e76cb, 0xa691e5bf], [0x0cd0d63b, 0x2c30bc41],
|
||||
[0x1f8ccf68, 0x23058f8a], [0x54e5ed5b, 0x88e3775d], [0x4ad12aae, 0x0a6d6031],
|
||||
[0x3e7f16bb, 0x88222e0d], [0x8af8671d, 0x3fb50c2c], [0x995ad117, 0x8bd25c31],
|
||||
[0xc878c1dd, 0x04c4b633], [0x3b72066c, 0x7a1552ac], [0x0d6f3522, 0x631effcb]
|
||||
];
|
||||
|
||||
t = [17, 18, 21, 31, 67, 89];
|
||||
rs = [10, 5, 13, 10, 11, 12, 2, 7, 14, 15, 7, 13, 11, 7, 6, 12];
|
||||
ls = [11, 24, 9, 16, 15, 9, 27, 15, 6, 2, 29, 8, 15, 5, 31, 9];
|
||||
|
||||
function f(N) {
|
||||
var i, j, s, x, S = [].concat(S0), A = [].concat(N);
|
||||
|
||||
for (j = 0, i = n; j < r; j += 1, i += 16) {
|
||||
for (s = 0; s < 16; s += 1) {
|
||||
x = [].concat(S);
|
||||
x = _xor(x, A[i + s - t[5]]);
|
||||
x = _xor(x, A[i + s - t[0]]);
|
||||
x = _xor(x, _and(A[i + s - t[1]], A[i + s - t[2]]));
|
||||
x = _xor(x, _and(A[i + s - t[3]], A[i + s - t[4]]));
|
||||
x = _xor(x, _shr(x, rs[s]));
|
||||
A[i + s] = _xor(x, _shl(x, ls[s]));
|
||||
}
|
||||
|
||||
S = _xor(_xor(_shl(S, 1), _shr(S, (64 - 1))), _and(S, Sm));
|
||||
}
|
||||
|
||||
return A.slice(A.length - 16);
|
||||
}
|
||||
|
||||
function mid(B, C, i, p, z) {
|
||||
var U, V;
|
||||
|
||||
U = [
|
||||
((ell & 0xff) << 24) | ((i / Math.pow(2, 32)) & 0xffffff),
|
||||
i & 0xffffffff
|
||||
];
|
||||
|
||||
V = [
|
||||
((r & 0xfff) << 16) | ((L & 0xff) << 8) | ((z & 0xf) << 4) | ((p & 0xf000) >> 12),
|
||||
(((p & 0xfff) << 20) | ((k & 0xff) << 12) | ((d & 0xfff)))
|
||||
];
|
||||
|
||||
return f([].concat(Q, K, [U, V], C, B));
|
||||
}
|
||||
|
||||
function par(M) {
|
||||
var i, l, p, z, P = 0, B = [], C = [];
|
||||
z = (M.length > b ? 0 : 1);
|
||||
|
||||
while ((M.length < 1) || ((M.length % b) > 0)) {
|
||||
M.push(0x00);
|
||||
P += 8;
|
||||
}
|
||||
|
||||
M = to_word(M);
|
||||
|
||||
while (M.length > 0) {
|
||||
B.push(M.slice(0, (b / 8)));
|
||||
M = M.slice(b / 8);
|
||||
}
|
||||
|
||||
for (i = 0, p = 0, l = B.length; i < l; i += 1, p = 0) {
|
||||
p = (i === (B.length - 1)) ? P : 0;
|
||||
C = C.concat(mid(B[i], [], i, p, z));
|
||||
}
|
||||
|
||||
return from_word(C);
|
||||
}
|
||||
|
||||
function seq(M) {
|
||||
var i, l, p, z, P = 0, B = [], C = [
|
||||
[0x0, 0x0], [0x0, 0x0], [0x0, 0x0], [0x0, 0x0],
|
||||
[0x0, 0x0], [0x0, 0x0], [0x0, 0x0], [0x0, 0x0],
|
||||
[0x0, 0x0], [0x0, 0x0], [0x0, 0x0], [0x0, 0x0],
|
||||
[0x0, 0x0], [0x0, 0x0], [0x0, 0x0], [0x0, 0x0]
|
||||
];
|
||||
|
||||
while ((M.length < 1) || ((M.length % (b - c)) > 0)) {
|
||||
M.push(0x00);
|
||||
P += 8;
|
||||
}
|
||||
|
||||
M = to_word(M);
|
||||
|
||||
while (M.length > 0) {
|
||||
B.push(M.slice(0, ((b - c) / 8)));
|
||||
M = M.slice((b - c) / 8);
|
||||
}
|
||||
|
||||
for (i = 0, p = 0, l = B.length; i < l; i += 1, p = 0) {
|
||||
p = (i === (B.length - 1)) ? P : 0;
|
||||
z = (i === (B.length - 1)) ? 1 : 0;
|
||||
C = mid(B[i], C, i, p, z);
|
||||
}
|
||||
|
||||
return from_word(C);
|
||||
}
|
||||
|
||||
do {
|
||||
ell += 1;
|
||||
M = ell > L ? seq(M) : par(M);
|
||||
}
|
||||
while (M.length !== c);
|
||||
|
||||
return crop(d, M, true);
|
||||
}
|
||||
|
||||
function bytes(input) {
|
||||
var output = [], i, ch;
|
||||
|
||||
for (i = 0; i < input.length; i++) {
|
||||
ch = input.charCodeAt(i);
|
||||
if (ch <= 0x7f) {
|
||||
output.push(ch);
|
||||
}
|
||||
else if (ch <= 0x7ff) {
|
||||
output.push((ch >> 6) | 0xc0);
|
||||
output.push((ch & 0x3F) | 0x80);
|
||||
}
|
||||
else if (ch <= 0xffff) {
|
||||
output.push((ch >> 12) | 0xe0);
|
||||
output.push(((ch >> 6) & 0x3f) | 0x80);
|
||||
output.push((ch & 0x3f) | 0x80);
|
||||
}
|
||||
else {
|
||||
output.push((ch >> 18) | 0xf0);
|
||||
output.push(((ch >> 12) & 0x3f) | 0x80);
|
||||
output.push(((ch >> 6) & 0x3f) | 0x80);
|
||||
output.push((ch & 0x3f) | 0x80);
|
||||
}
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
function _prehash(data, size, key, levels) {
|
||||
if (typeof data === "undefined") data = "";
|
||||
if (typeof size === "undefined") size = 256;
|
||||
if (typeof key === "undefined") key = "";
|
||||
if (typeof levels === "undefined") levels = 64;
|
||||
|
||||
data = bytes(data);
|
||||
key = bytes(key);
|
||||
|
||||
if (size <= 0) size = 1;
|
||||
else if (size > 512) size = 512;
|
||||
|
||||
return _hash(size, data, key, levels);
|
||||
}
|
||||
|
||||
function _hex(data, size, key, levels) {
|
||||
var hash = _prehash(data, size, key, levels);
|
||||
var hex = "";
|
||||
var i;
|
||||
|
||||
for (i = 0; i < hash.length; i++) {
|
||||
var v = hash[i];
|
||||
var x = v.toString(16);
|
||||
if (x.length === 1) x = "0" + x;
|
||||
hex += x;
|
||||
}
|
||||
|
||||
return hex;
|
||||
}
|
||||
|
||||
function _raw(data, size, key, levels) {
|
||||
var hash = _prehash(data, size, key, levels);
|
||||
var raw = "";
|
||||
var i;
|
||||
|
||||
for (i = 0; i < hash.length; i++) {
|
||||
var v = hash[i];
|
||||
raw += String.fromCharCode(v);
|
||||
}
|
||||
|
||||
return raw;
|
||||
}
|
||||
|
||||
return {
|
||||
hex: _hex,
|
||||
raw: _raw
|
||||
};
|
||||
};
|
||||
|
||||
if(typeof exports !== "undefined") exports.md6hash = md6hash;
|
||||
if (typeof exports !== "undefined") exports = md6hash;
|
||||
@@ -1,267 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* md6hash for PHP
|
||||
*
|
||||
* Usage :
|
||||
* $md6 = new md6hash;
|
||||
* $data = "md6 FTW";
|
||||
* $result = $md6->hex($data);
|
||||
* echo $result; // 7bfaa624f661a683be2a3b2007493006a30a7845ee1670e499927861a8e74cce
|
||||
*
|
||||
*/
|
||||
class md6hash {
|
||||
private function to_word($input) {
|
||||
$output = array();
|
||||
|
||||
for($i = 0 ; $i < count($input) ; $i += 8) {
|
||||
array_push($output, array(
|
||||
(($input[$i ] << 24) | ($input[$i+1] << 16) | ($input[$i+2] << 8) | ($input[$i+3])),
|
||||
(($input[$i+4] << 24) | ($input[$i+5] << 16) | ($input[$i+6] << 8) | ($input[$i+7]))
|
||||
));
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
private function from_word($input) {
|
||||
$output = array();
|
||||
|
||||
for($i = 0 ; $i < count($input) ; $i += 1) {
|
||||
array_push($output, ($input[$i][0] >> 24) & 0xff);
|
||||
array_push($output, ($input[$i][0] >> 16) & 0xff);
|
||||
array_push($output, ($input[$i][0] >> 8) & 0xff);
|
||||
array_push($output, ($input[$i][0] >> 0) & 0xff);
|
||||
array_push($output, ($input[$i][1] >> 24) & 0xff);
|
||||
array_push($output, ($input[$i][1] >> 16) & 0xff);
|
||||
array_push($output, ($input[$i][1] >> 8) & 0xff);
|
||||
array_push($output, ($input[$i][1] >> 0) & 0xff);
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
private function _xor($x, $y) {
|
||||
return array($x[0] ^ $y[0], $x[1] ^ $y[1]);
|
||||
}
|
||||
|
||||
private function _and($x, $y) {
|
||||
return array($x[0] & $y[0], $x[1] & $y[1]);
|
||||
}
|
||||
private function _shl($x, $n) {
|
||||
$a = $x[0];
|
||||
$b = $x[1];
|
||||
|
||||
if($n >= 32) {
|
||||
return array(($b << ($n - 32)) & 0xffffffff, 0x00000000);
|
||||
}
|
||||
else {
|
||||
return array((($a << $n) | ($b >> (32 - $n))) & 0xffffffff, ($b << $n) & 0xffffffff);
|
||||
}
|
||||
}
|
||||
|
||||
private function _shr($x, $n) {
|
||||
$a = $x[0];
|
||||
$b = $x[1];
|
||||
|
||||
if($n >= 32) {
|
||||
return array(0x00000000, $a >> ($n - 32));
|
||||
}
|
||||
else {
|
||||
return array(($a >> $n) & 0xffffffff, (($a << (32 - $n)) | ($b >> $n)) & 0xffffffff);
|
||||
}
|
||||
}
|
||||
|
||||
private function crop($size, $hash, $right = false) {
|
||||
$length = floor(($size + 7) / 8);
|
||||
$remain = $size % 8;
|
||||
|
||||
if($right) {
|
||||
$hash = array_slice($hash, count($hash) - $length);
|
||||
}
|
||||
else {
|
||||
$hash = array_slice($hash, 0, $length);
|
||||
}
|
||||
if($remain > 0) {
|
||||
$hash[$length - 1] &= (0xff << (8 - $remain)) & 0xff;
|
||||
}
|
||||
|
||||
return $hash;
|
||||
}
|
||||
|
||||
private function bytes($input) {
|
||||
$output = array();
|
||||
$length = strlen($input);
|
||||
|
||||
for($i = 0 ; $i < $length ; $i++) {
|
||||
array_push($output, ord($input[$i]));
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
private function f($N) {
|
||||
$S = array_merge(array(), $this->S0);
|
||||
$A = array_merge(array(), $N);
|
||||
|
||||
for($j = 0, $i = $this->n ; $j < $this->r ; $j += 1, $i += 16) {
|
||||
for($s = 0 ; $s < 16 ; $s += 1) {
|
||||
$x = array_merge(array(), $S);
|
||||
$x = $this->_xor($x, $A[$i + $s - $this->t[5]]);
|
||||
$x = $this->_xor($x, $A[$i + $s - $this->t[0]]);
|
||||
$x = $this->_xor($x, $this->_and($A[$i + $s - $this->t[1]], $A[$i + $s - $this->t[2]]));
|
||||
$x = $this->_xor($x, $this->_and($A[$i + $s - $this->t[3]], $A[$i + $s - $this->t[4]]));
|
||||
$x = $this->_xor($x, $this->_shr($x, $this->rs[$s]));
|
||||
$A[$i + $s] = $this->_xor($x, $this->_shl($x, $this->ls[$s]));
|
||||
}
|
||||
|
||||
$S = $this->_xor($this->_xor($this->_shl($S, 1), $this->_shr($S, 63)), $this->_and($S, $this->Sm));
|
||||
}
|
||||
return array_slice($A, count($A) - 16);
|
||||
}
|
||||
|
||||
private function mid($B, $C, $i, $p, $z) {
|
||||
$U = array(
|
||||
(($this->ell & 0xff) << 24) | (($i / 0xffffffff) & 0xffffff),
|
||||
$i & 0xffffffff
|
||||
);
|
||||
|
||||
$V = array(
|
||||
(($this->r & 0xfff) << 16) | (($this->L & 0xff) << 8) | (($z & 0xf) << 4) | (($p & 0xf000) >> 12),
|
||||
(($p & 0xfff) << 20) | (($this->k & 0xff) << 12) | (($this->d & 0xfff))
|
||||
);
|
||||
|
||||
return $this->f(array_merge($this->Q, $this->K, array($U, $V), $C, $B));
|
||||
}
|
||||
|
||||
private function par($M) {
|
||||
$P = 0;
|
||||
$B = array();
|
||||
$C = array();
|
||||
|
||||
$z = count($M) > $this->b ? 0 : 1;
|
||||
|
||||
while(count($M) < 1 || (count($M) % $this->b) > 0) {
|
||||
array_push($M, 0x00);
|
||||
$P += 8;
|
||||
}
|
||||
|
||||
$M = $this->to_word($M);
|
||||
|
||||
while(count($M) > 0) {
|
||||
array_push($B, array_slice($M, 0, ($this->b / 8)));
|
||||
$M = array_slice($M, $this->b / 8);
|
||||
}
|
||||
|
||||
for($i = 0, $p = 0, $l = count($B) ; $i < $l ; $i += 1, $p = 0) {
|
||||
$p = ($i === (count($B) - 1)) ? $P : 0;
|
||||
$C = array_merge($C, $this->mid($B[$i], array(), $i, $p, $z));
|
||||
}
|
||||
|
||||
return $this->from_word($C);
|
||||
}
|
||||
|
||||
private function seq($M) {
|
||||
$P = 0;
|
||||
$B = array();
|
||||
$C = array(
|
||||
array(0x0, 0x0), array(0x0, 0x0), array(0x0, 0x0), array(0x0, 0x0),
|
||||
array(0x0, 0x0), array(0x0, 0x0), array(0x0, 0x0), array(0x0, 0x0),
|
||||
array(0x0, 0x0), array(0x0, 0x0), array(0x0, 0x0), array(0x0, 0x0),
|
||||
array(0x0, 0x0), array(0x0, 0x0), array(0x0, 0x0), array(0x0, 0x0)
|
||||
);
|
||||
|
||||
while(count($M) < 1 || (count($M) % ($this->b - $this->c)) > 0) {
|
||||
array_push($M, 0x00);
|
||||
$P += 8;
|
||||
}
|
||||
|
||||
$M = $this->to_word($M);
|
||||
|
||||
while(count($M) > 0) {
|
||||
array_push($B, array_slice($M, 0, (($this->b - $this->c) / 8)));
|
||||
$M = array_slice(($this->b - $this->c) / 8);
|
||||
}
|
||||
|
||||
for($i = 0, $p = 0, $l = count($B) ; $i < $l ; $i += 1, $p = 0) {
|
||||
$p = ($i === (count($B) - 1)) ? $P : 0;
|
||||
$z = ($i === (count($B) - 1)) ? 1 : 0;
|
||||
$C = $this->mid($B[$i], $C, $i, $p, $z);
|
||||
}
|
||||
|
||||
return $this->from_word($C);
|
||||
}
|
||||
|
||||
private $b, $c, $n, $d, $K, $k, $r, $L, $ell, $S0, $Sm, $Q, $t, $rs, $ls;
|
||||
|
||||
private function _hash($data, $size, $key, $levels) {
|
||||
$this->b = 512;
|
||||
$this->c = 128;
|
||||
|
||||
$this->n = 89;
|
||||
|
||||
$this->d = $size;
|
||||
$this->M = $data;
|
||||
|
||||
$this->K = array_slice($key, 0, 64);
|
||||
$this->k = count($this->K);
|
||||
|
||||
while(count($this->K) < 64) {
|
||||
array_push($this->K, 0x00);
|
||||
}
|
||||
|
||||
$this->K = $this->to_word($this->K);
|
||||
|
||||
$this->r = max(($this->k ? 80 : 0), (40 + ($this->d / 4)));
|
||||
|
||||
$this->L = $levels;
|
||||
$this->ell = 0;
|
||||
|
||||
$this->S0 = array(0x01234567, 0x89abcdef);
|
||||
$this->Sm = array(0x7311c281, 0x2425cfa0);
|
||||
|
||||
$this->Q = array(
|
||||
array(0x7311c281, 0x2425cfa0), array(0x64322864, 0x34aac8e7), array(0xb60450e9, 0xef68b7c1),
|
||||
array(0xe8fb2390, 0x8d9f06f1), array(0xdd2e76cb, 0xa691e5bf), array(0x0cd0d63b, 0x2c30bc41),
|
||||
array(0x1f8ccf68, 0x23058f8a), array(0x54e5ed5b, 0x88e3775d), array(0x4ad12aae, 0x0a6d6031),
|
||||
array(0x3e7f16bb, 0x88222e0d), array(0x8af8671d, 0x3fb50c2c), array(0x995ad117, 0x8bd25c31),
|
||||
array(0xc878c1dd, 0x04c4b633), array(0x3b72066c, 0x7a1552ac), array(0x0d6f3522, 0x631effcb)
|
||||
);
|
||||
|
||||
$this->t = array(17, 18, 21, 31, 67, 89);
|
||||
$this->rs = array(10, 5, 13, 10, 11, 12, 2, 7, 14, 15, 7, 13, 11, 7, 6, 12);
|
||||
$this->ls = array(11, 24, 9, 16, 15, 9, 27, 15, 6, 2, 29, 8, 15, 5, 31, 9);
|
||||
|
||||
do {
|
||||
$this->ell += 1;
|
||||
|
||||
$this->M = $this->ell > $this->L ? $this->seq($this->M) : $this->par($this->M);
|
||||
} while(count($this->M) !== $this->c);
|
||||
|
||||
return $this->crop($this->d, $this->M, true);
|
||||
}
|
||||
|
||||
private function _prehash($data, $size, $key, $levels) {
|
||||
$data = $this->bytes($data);
|
||||
$key = $this->bytes($key);
|
||||
|
||||
if($size <= 0) $size = 1;
|
||||
if($size > 512) $size = 512;
|
||||
|
||||
return $this->_hash($data, $size, $key, $levels);
|
||||
}
|
||||
|
||||
public function hex($data = "", $size = 256, $key = "", $levels = 64) {
|
||||
$hash = $this->_prehash($data, $size, $key, $levels);
|
||||
$hex = "";
|
||||
foreach($hash as $v) $hex .= str_pad(dechex($v), 2, "0", STR_PAD_LEFT);
|
||||
return $hex;
|
||||
}
|
||||
|
||||
public function raw($data = "", $size = 256, $key = "", $levels = 64) {
|
||||
$hash = $this->_prehash($data, $size, $key, $levels);
|
||||
$raw = "";
|
||||
foreach($hash as $v) $raw .= chr($v);
|
||||
return $raw;
|
||||
}
|
||||
}
|
||||
@@ -1,235 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#
|
||||
# md6hash for Python 2, 3
|
||||
#
|
||||
# Usage:
|
||||
# md6 = md6hash()
|
||||
# data = "md6 FTW"
|
||||
# result = md6.hex(data)
|
||||
# print(result)
|
||||
#
|
||||
|
||||
import binascii
|
||||
|
||||
class md6hash():
|
||||
def __to_word(self, i_byte):
|
||||
length = len(i_byte)
|
||||
o_word = []
|
||||
|
||||
for i in range(0, length, 8):
|
||||
o_word.append(
|
||||
((i_byte[i + 0] & 0xff) << 56) |
|
||||
((i_byte[i + 1] & 0xff) << 48) |
|
||||
((i_byte[i + 2] & 0xff) << 40) |
|
||||
((i_byte[i + 3] & 0xff) << 32) |
|
||||
((i_byte[i + 4] & 0xff) << 24) |
|
||||
((i_byte[i + 5] & 0xff) << 16) |
|
||||
((i_byte[i + 6] & 0xff) << 8) |
|
||||
((i_byte[i + 7] & 0xff) << 0)
|
||||
)
|
||||
|
||||
return o_word
|
||||
|
||||
def __from_word(self, i_word):
|
||||
length = len(i_word)
|
||||
o_byte = []
|
||||
|
||||
for i in range(length):
|
||||
o_byte.append((i_word[i] >> 56) & 0xff)
|
||||
o_byte.append((i_word[i] >> 48) & 0xff)
|
||||
o_byte.append((i_word[i] >> 40) & 0xff)
|
||||
o_byte.append((i_word[i] >> 32) & 0xff)
|
||||
o_byte.append((i_word[i] >> 24) & 0xff)
|
||||
o_byte.append((i_word[i] >> 16) & 0xff)
|
||||
o_byte.append((i_word[i] >> 8) & 0xff)
|
||||
o_byte.append((i_word[i] >> 0) & 0xff)
|
||||
|
||||
return o_byte
|
||||
|
||||
def __crop(self, size, data, right):
|
||||
length = int((size + 7) / 8)
|
||||
remain = size % 8
|
||||
|
||||
if right:
|
||||
data = data[len(data) - length:]
|
||||
else:
|
||||
data = data[:length]
|
||||
|
||||
if remain > 0:
|
||||
data[length - 1] &= (0xff << (8 - remain)) & 0xff
|
||||
|
||||
return data
|
||||
|
||||
def __hash(self, size, data, key, levels):
|
||||
b = 512
|
||||
c = 128
|
||||
n = 89
|
||||
d = size
|
||||
M = data
|
||||
|
||||
K = key[:64]
|
||||
k = len(K)
|
||||
|
||||
while len(K) < 64:
|
||||
K.append(0x00)
|
||||
|
||||
K = self.__to_word(K)
|
||||
|
||||
r = max(80 if k else 0, 40 + int(d / 4))
|
||||
|
||||
L = levels
|
||||
ell = 0
|
||||
|
||||
S0 = 0x0123456789abcdef
|
||||
Sm = 0x7311c2812425cfa0
|
||||
|
||||
Q = [
|
||||
0x7311c2812425cfa0, 0x6432286434aac8e7, 0xb60450e9ef68b7c1,
|
||||
0xe8fb23908d9f06f1, 0xdd2e76cba691e5bf, 0x0cd0d63b2c30bc41,
|
||||
0x1f8ccf6823058f8a, 0x54e5ed5b88e3775d, 0x4ad12aae0a6d6031,
|
||||
0x3e7f16bb88222e0d, 0x8af8671d3fb50c2c, 0x995ad1178bd25c31,
|
||||
0xc878c1dd04c4b633, 0x3b72066c7a1552ac, 0x0d6f3522631effcb
|
||||
];
|
||||
|
||||
t = [17, 18, 21, 31, 67, 89]
|
||||
rs = [10, 5, 13, 10, 11, 12, 2, 7, 14, 15, 7, 13, 11, 7, 6, 12]
|
||||
ls = [11, 24, 9, 16, 15, 9, 27, 15, 6, 2, 29, 8, 15, 5, 31, 9]
|
||||
|
||||
def f(N):
|
||||
S = S0
|
||||
A = list(N)
|
||||
|
||||
j = 0
|
||||
i = n
|
||||
|
||||
while j < r:
|
||||
for s in range(16):
|
||||
x = S
|
||||
x ^= A[i + s - t[5]]
|
||||
x ^= A[i + s - t[0]]
|
||||
x ^= A[i + s - t[1]] & A[i + s - t[2]]
|
||||
x ^= A[i + s - t[3]] & A[i + s - t[4]]
|
||||
x ^= x >> rs[s]
|
||||
|
||||
if len(A) <= i + s:
|
||||
while len(A) <= i + s:
|
||||
A.append(0x00)
|
||||
|
||||
A[i + s] = x ^ ((x << ls[s]) & 0xffffffffffffffff)
|
||||
|
||||
S = (((S << 1) & 0xffffffffffffffff) ^ (S >> 63)) ^ (S & Sm)
|
||||
|
||||
j += 1
|
||||
i += 16
|
||||
|
||||
return A[(len(A) - 16):]
|
||||
|
||||
def mid(B, C, i, p, z):
|
||||
U = ((ell & 0xff) << 56) | i & 0xffffffffffffff
|
||||
V = ((r & 0xfff) << 48) | ((L & 0xff) << 40) | ((z & 0xf) << 36) | ((p & 0xffff) << 20) | ((k & 0xff) << 12) | (d & 0xfff)
|
||||
|
||||
return f(Q + K + [U, V] + C + B)
|
||||
|
||||
def par(M):
|
||||
P = 0
|
||||
B = []
|
||||
C = []
|
||||
z = 0 if len(M) > b else 1
|
||||
|
||||
while len(M) < 1 or (len(M) % b) > 0:
|
||||
M.append(0x00)
|
||||
P += 8
|
||||
|
||||
M = self.__to_word(M)
|
||||
|
||||
while len(M) > 0:
|
||||
B.append(M[:int(b / 8)])
|
||||
M = M[int(b / 8):]
|
||||
|
||||
i = 0
|
||||
p = 0
|
||||
l = len(B)
|
||||
|
||||
while i < l:
|
||||
p = P if i == (len(B) - 1) else 0
|
||||
C += mid(B[i], [], i, p, z)
|
||||
|
||||
i += 1
|
||||
p = 0
|
||||
|
||||
return self.__from_word(C)
|
||||
|
||||
def seq(M):
|
||||
P = 0
|
||||
B = []
|
||||
C = [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0]
|
||||
|
||||
while len(M) < 1 or (len(M) % (b - c)) > 0:
|
||||
M.append(0x00)
|
||||
P += 8
|
||||
|
||||
M = self.__to_word(M)
|
||||
|
||||
while len(M) > 0:
|
||||
B.append(M[:int((b - c) / 8)])
|
||||
M = M[int((b - c) / 8):]
|
||||
|
||||
i = 0
|
||||
p = 0
|
||||
l = len(B)
|
||||
|
||||
while i < l:
|
||||
p = P if i == (len(B) - 1) else 0
|
||||
z = 1 if i == (len(B) - 1) else 0
|
||||
C = mid(B[i], C, i, p, z)
|
||||
|
||||
i += 1
|
||||
p = 0
|
||||
|
||||
return self.__from_word(C)
|
||||
|
||||
while True:
|
||||
ell += 1
|
||||
M = seq(M) if ell > L else par(M)
|
||||
|
||||
if len(M) == c:
|
||||
break
|
||||
|
||||
return self.__crop(d, M, True)
|
||||
|
||||
def __bytes(self, i_str):
|
||||
i_str = binascii.hexlify(i_str.encode("ascii"))
|
||||
o_byte = [int(i_str[i:i+2], 16) for i in range(0, len(i_str), 2)]
|
||||
|
||||
return o_byte
|
||||
|
||||
def __prehash(self, data, size, key, levels):
|
||||
data = self.__bytes(data)
|
||||
key = self.__bytes(key)
|
||||
|
||||
if size <= 0:
|
||||
size = 1
|
||||
elif size > 512:
|
||||
size = 512
|
||||
|
||||
return self.__hash(size, data, key, levels)
|
||||
|
||||
def hex(self, data="", size=256, key="", levels=64):
|
||||
byte = self.__prehash(data, size, key, levels)
|
||||
hexstr = ""
|
||||
|
||||
for i in byte:
|
||||
hexstr += "%02x" % i
|
||||
|
||||
return hexstr
|
||||
|
||||
def raw(self, data="", size=256, key="", levels=64):
|
||||
byte = self.__prehash(data, size, key, levels)
|
||||
rawstr = ""
|
||||
|
||||
for i in byte:
|
||||
rawstr += chr(i)
|
||||
|
||||
return rawstr
|
||||
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"name": "node-md6",
|
||||
"version": "0.0.1",
|
||||
"description": "MD6 Implementation in Node",
|
||||
"main": "md6.js",
|
||||
"files": [
|
||||
"md6.js"
|
||||
],
|
||||
"directories": {
|
||||
"test": "test"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/Neo-Desktop/md6.git"
|
||||
},
|
||||
"keywords": [
|
||||
"node",
|
||||
"cryptography",
|
||||
"message",
|
||||
"digest",
|
||||
"6",
|
||||
"md6",
|
||||
"md6js"
|
||||
],
|
||||
"author": "Amrit Panesar",
|
||||
"license": "CC0-1.0",
|
||||
"bugs": {
|
||||
"url": "https://github.com/Neo-Desktop/md6/issues"
|
||||
},
|
||||
"homepage": "https://github.com/Neo-Desktop/md6#readme"
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
<?php
|
||||
|
||||
require("../md6.php");
|
||||
|
||||
$md6 = new md6hash();
|
||||
$result = file("result.csv");
|
||||
|
||||
$total = 0;
|
||||
$ok = 0;
|
||||
|
||||
foreach($result as $line) {
|
||||
$a = explode(",", trim($line));
|
||||
$size = intval($a[0]);
|
||||
$data = $a[1];
|
||||
$comp = $a[2];
|
||||
|
||||
$hash = $md6->hex($data, $size);
|
||||
|
||||
$total++;
|
||||
if($hash === $comp) $ok++;
|
||||
}
|
||||
|
||||
echo "{$ok} / {$total} test(s) passed.".PHP_EOL;
|
||||
@@ -1,24 +0,0 @@
|
||||
import sys
|
||||
sys.path.append("..")
|
||||
|
||||
from md6 import md6hash
|
||||
|
||||
md6 = md6hash()
|
||||
f = open("result.csv", "r")
|
||||
result = f.readlines()
|
||||
f.close()
|
||||
|
||||
total = 0
|
||||
ok = 0
|
||||
|
||||
for line in result:
|
||||
size, data, comp = line.strip().split(",")
|
||||
size = int(size)
|
||||
|
||||
hash = md6.hex(data, size)
|
||||
|
||||
total += 1
|
||||
if hash == comp:
|
||||
ok += 1
|
||||
|
||||
print "%d / %d test(s) passed." % (ok, total)
|
||||
Reference in new issue
Block a user