Skip to content

Commit

Permalink
FNV1a32String
Browse files Browse the repository at this point in the history
  • Loading branch information
Narazaka committed Mar 13, 2024
1 parent dfa6f1d commit 1440f1f
Show file tree
Hide file tree
Showing 11 changed files with 103 additions and 17 deletions.
7 changes: 0 additions & 7 deletions FNV1a32.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,5 @@ public static uint ComputeHash(byte[] bytes)
}
return hash;
}

#if HAS_UDON_ENCODING
public static uint ComputeHash(string str)
{
return ComputeHash(Koyashiro.UdonEncoding.UdonUTF8.GetBytes(str));
}
#endif
}
}
12 changes: 2 additions & 10 deletions Narazaka.SimpleHash.asmdef
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
{
"name": "Narazaka.SimpleHash",
"rootNamespace": "",
"references": [
"Koyashiro.UdonEncoding"
],
"references": [],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [
{
"name": "net.koyashiro.udonencoding",
"expression": "0.4.4",
"define": "HAS_UDON_ENCODING"
}
],
"versionDefines": [],
"noEngineReferences": false
}
16 changes: 16 additions & 0 deletions Narazaka.SimpleHash.asset
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5136146375e9a0a498a72a0091b40cc1, type: 3}
m_Name: Narazaka.SimpleHash
m_EditorClassIdentifier:
sourceAssembly: {fileID: 5897886265953266890, guid: 5b0c9699ef476e2499186cdd8a56a723,
type: 3}
8 changes: 8 additions & 0 deletions Narazaka.SimpleHash.asset.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions UdonEncoding.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions UdonEncoding/FNV1a32String.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace Narazaka.SimpleHash
{
public static class FNV1a32String
{
public static uint ComputeHash(string str)
{
return FNV1a32.ComputeHash(Koyashiro.UdonEncoding.UdonUTF8.GetBytes(str));
}
}
}
11 changes: 11 additions & 0 deletions UdonEncoding/FNV1a32String.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions UdonEncoding/Narazaka.SimpleHash.UdonEncoding.asmdef
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "Narazaka.SimpleHash.UdonEncoding",
"rootNamespace": "",
"references": [
"Koyashiro.UdonEncoding",
"Narazaka.SimpleHash"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}
7 changes: 7 additions & 0 deletions UdonEncoding/Narazaka.SimpleHash.UdonEncoding.asmdef.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions UdonEncoding/Narazaka.SimpleHash.UdonEncoding.asset
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5136146375e9a0a498a72a0091b40cc1, type: 3}
m_Name: Narazaka.SimpleHash.UdonEncoding
m_EditorClassIdentifier:
sourceAssembly: {fileID: 5897886265953266890, guid: 9669b5b21a7a1984181257de55956458,
type: 3}
8 changes: 8 additions & 0 deletions UdonEncoding/Narazaka.SimpleHash.UdonEncoding.asset.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1440f1f

Please sign in to comment.