Verified Commit 0f6b95bf authored by RobLoach's avatar RobLoach
Browse files

sha1: Update SHA1 usage

parent 41751e41
......@@ -4,6 +4,10 @@ All notable changes to [ChaiLove](https://github.com/RobLoach/ChaiLove) will be
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## 0.19.1 - Development Branch
- `love.data.hash()` `sha1` support
## 0.19.0 - 2018-04-13
### Added
- Android build
......
......@@ -7,6 +7,7 @@
#include <iostream>
#include "zlib.h"
#include "utils/md5.h"
#include "TinySHA1.hpp"
namespace love {
......@@ -120,7 +121,7 @@ std::string data::hash(const std::string& hashFunction, const std::string& data)
uint32_t digest[5];
s.getDigest(digest);
char tmp[48];
snprintf(tmp, 45, "%08x %08x %08x %08x %08x", digest[0], digest[1], digest[2], digest[3], digest[4]);
snprintf(tmp, sizeof(tmp), "%08x%08x%08x%08x%08x", digest[0], digest[1], digest[2], digest[3], digest[4]);
return std::string(tmp);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment