File tree 2 files changed +13
-1
lines changed
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: ac6e1131e91d27f1211e028587e5f68e2900cdd2
2
+ refs/heads/master: e99feabf47351a461518760e6f5f5086e11e7c17
Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ state type sha1 = state obj {
19
19
// until reset is called
20
20
fn result ( ) -> vec[ u8 ] ;
21
21
22
+ // Same as above, just a hex-string version.
23
+ fn result_str ( ) -> str ;
24
+
22
25
// Reset the sha1 state for reuse. This is called
23
26
// automatically during construction
24
27
fn reset ( ) ;
@@ -259,6 +262,15 @@ fn mk_sha1() -> sha1 {
259
262
fn result ( ) -> vec[ u8 ] {
260
263
ret mk_result ( st) ;
261
264
}
265
+
266
+ fn result_str ( ) -> str {
267
+ auto r = mk_result ( st) ;
268
+ auto s = "" ;
269
+ for ( u8 b in r) {
270
+ s += _uint. to_str ( b as uint , 16 u) ;
271
+ }
272
+ ret s;
273
+ }
262
274
}
263
275
264
276
auto st = rec ( h = _vec. init_elt_mut [ u32] ( 0u32 , digest_buf_len) ,
You can’t perform that action at this time.
0 commit comments