Skip to content

Commit

Permalink
Update Sha1
Browse files Browse the repository at this point in the history
  • Loading branch information
holdyounger committed Dec 4, 2023
1 parent 26b9f46 commit ef8491b
Show file tree
Hide file tree
Showing 12 changed files with 1,413 additions and 0 deletions.
261 changes: 261 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,261 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/

# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

# NUNIT
*.VisualState.xml
TestResult.xml

# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c

# DNX
project.lock.json
project.fragment.lock.json
artifacts/

*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc

# Chutzpah Test files
_Chutzpah*

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb

# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap

# TFS 2012 Local Workspace
$tf/

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# JustCode is a .NET coding add-in
.JustCode

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*

# MightyMoose
*.mm.*
AutoTest.Net/

# Web workbench (sass)
.sass-cache/

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
#*.pubxml
*.publishproj

# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/

# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets

# Microsoft Azure Build Output
csx/
*.build.csdef

# Microsoft Azure Emulator
ecf/
rcf/

# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt

# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/

# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs

# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
*.mdf
*.ldf

# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings

# Microsoft Fakes
FakesAssemblies/

# GhostDoc plugin setting file
*.GhostDoc.xml

# Node.js Tools for Visual Studio
.ntvs_analysis.dat

# Visual Studio 6 build log
*.plg

# Visual Studio 6 workspace options file
*.opt

# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions

# Paket dependency manager
.paket/paket.exe
paket-files/

# FAKE - F# Make
.fake/

# JetBrains Rider
.idea/
*.sln.iml

# CodeRush
.cr/

# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
25 changes: 25 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <http://unlicense.org>

73 changes: 73 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<h1 align="center">Welcome to SHA1 👋</h1>
<p>
<img alt="Version" src="https://img.shields.io/badge/version-v1.0-blue.svg?cacheSeconds=2592000" />
</p>

> fork by [vog/sha1: SHA-1 implementation in C++. Do not use SHA-1 unless you have to! https://en.wikipedia.org/wiki/SHA-1#Birthday-Near-Collision\_Attack\_%E2%80%93\_first\_practical\_chosen-prefix\_attack](https://github.com/vog/sha1)


## 测试结果

计算 readme.md 文件的sha1

![计算结果](README/image-20231204154805601.png)

测试用例

```
Test: abc
Result: a9993e364706816aba3e25717850c26c9cd0d89d
Expected: a9993e364706816aba3e25717850c26c9cd0d89d (OK)
Test: abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq
Result: 84983e441c3bd26ebaae4aa1f95129e5e54670f1
Expected: 84983e441c3bd26ebaae4aa1f95129e5e54670f1 (OK)
Test: abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu
Result: a49b2446a02c645bf419f995b67091253a04a259
Expected: a49b2446a02c645bf419f995b67091253a04a259 (OK)
Test: A million repetitions of 'a'
Result: 34aa973cd4c4daa4f61eeb2bdbad27316534016f
Expected: 34aa973cd4c4daa4f61eeb2bdbad27316534016f (OK)
Test: The quick brown fox jumps over the lazy dog
Result: 2fd4e1c67a2d28fced849ee1bb76e7391b93eb12
Expected: 2fd4e1c67a2d28fced849ee1bb76e7391b93eb12 (OK)
Test: The quick brown fox jumps over the lazy cog
Result: de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3
Expected: de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3 (OK)
Test: No string
Result: da39a3ee5e6b4b0d3255bfef95601890afd80709
Expected: da39a3ee5e6b4b0d3255bfef95601890afd80709 (OK)
Test: Empty string
Result: da39a3ee5e6b4b0d3255bfef95601890afd80709
Expected: da39a3ee5e6b4b0d3255bfef95601890afd80709 (OK)
Test: abcde
Result: 03de6c570bfe24bfc328ccd7ca46b76eadaf4334
Expected: 03de6c570bfe24bfc328ccd7ca46b76eadaf4334 (OK)
Test: Two concurrent checksum calculations
Result: da39a3ee5e6b4b0d3255bfef95601890afd80709
Expected: da39a3ee5e6b4b0d3255bfef95601890afd80709 (OK)
Result: a9993e364706816aba3e25717850c26c9cd0d89d
Expected: a9993e364706816aba3e25717850c26c9cd0d89d (OK)
Test: a [00] b [7F] c [80] d [FF] e [C3] [F0] f
Result: cd0dd10814c0d4f9c6a2a0a4be2304d2371468d3
Expected: cd0dd10814c0d4f9c6a2a0a4be2304d2371468d3 (OK)
```



## Show your support

Give a ⭐️ if this project helped you!

***
_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_
Binary file added README/image-20231204154805601.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions SHA1.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34309.116
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SHA1", "SHA1.vcxproj", "{33C7192F-691D-4B71-8F28-738147027FF8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{33C7192F-691D-4B71-8F28-738147027FF8}.Debug|x64.ActiveCfg = Debug|x64
{33C7192F-691D-4B71-8F28-738147027FF8}.Debug|x64.Build.0 = Debug|x64
{33C7192F-691D-4B71-8F28-738147027FF8}.Debug|x86.ActiveCfg = Debug|Win32
{33C7192F-691D-4B71-8F28-738147027FF8}.Debug|x86.Build.0 = Debug|Win32
{33C7192F-691D-4B71-8F28-738147027FF8}.Release|x64.ActiveCfg = Release|x64
{33C7192F-691D-4B71-8F28-738147027FF8}.Release|x64.Build.0 = Release|x64
{33C7192F-691D-4B71-8F28-738147027FF8}.Release|x86.ActiveCfg = Release|Win32
{33C7192F-691D-4B71-8F28-738147027FF8}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9E8B9183-BE23-4D69-B457-82FABB18B1BD}
EndGlobalSection
EndGlobal
Loading

0 comments on commit ef8491b

Please sign in to comment.