-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathAlgoArgon2.cs
More file actions
53 lines (45 loc) · 1.42 KB
/
AlgoArgon2.cs
File metadata and controls
53 lines (45 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System;
using System.Linq;
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;
using Appwrite.Enums;
using Appwrite.Extensions;
namespace Appwrite.Models
{
public class AlgoArgon2
{
[JsonPropertyName("type")]
public string Type { get; private set; }
[JsonPropertyName("memoryCost")]
public long MemoryCost { get; private set; }
[JsonPropertyName("timeCost")]
public long TimeCost { get; private set; }
[JsonPropertyName("threads")]
public long Threads { get; private set; }
public AlgoArgon2(
string type,
long memoryCost,
long timeCost,
long threads
) {
Type = type;
MemoryCost = memoryCost;
TimeCost = timeCost;
Threads = threads;
}
public static AlgoArgon2 From(Dictionary<string, object> map) => new AlgoArgon2(
type: map["type"].ToString(),
memoryCost: Convert.ToInt64(map["memoryCost"]),
timeCost: Convert.ToInt64(map["timeCost"]),
threads: Convert.ToInt64(map["threads"])
);
public Dictionary<string, object?> ToMap() => new Dictionary<string, object?>()
{
{ "type", Type },
{ "memoryCost", MemoryCost },
{ "timeCost", TimeCost },
{ "threads", Threads }
};
}
}