mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-12-26 01:45:49 +08:00
- 增加 ISelect.WhereCascade 实现多表查询时,向每个表中附加条件;
- 增加 Examples 项目 base_entity,利用 BaseEntity 实现简洁的数据库操作;
This commit is contained in:
@@ -3,6 +3,8 @@ using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Data.Common;
|
||||
using System.Diagnostics;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -33,4 +35,16 @@ public static class FreeUtil
|
||||
var guid = $"{uninxtime.ToString("x8").PadLeft(8, '0')}{__staticMachine.ToString("x8").PadLeft(8, '0').Substring(2, 6)}{__staticPid.ToString("x8").PadLeft(8, '0').Substring(6, 2)}{increment.ToString("x8").PadLeft(8, '0')}{rand.ToString("x8").PadLeft(8, '0')}";
|
||||
return Guid.Parse(guid);
|
||||
}
|
||||
|
||||
public static string Sha1(string str)
|
||||
{
|
||||
var buffer = Encoding.UTF8.GetBytes(str);
|
||||
var data = SHA1.Create().ComputeHash(buffer);
|
||||
|
||||
var sub = new StringBuilder();
|
||||
foreach (var t in data)
|
||||
sub.Append(t.ToString("X2"));
|
||||
|
||||
return sub.ToString();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user