diff options
author | Teddy Wing | 2018-11-06 01:32:23 +0100 |
---|---|---|
committer | Teddy Wing | 2018-11-06 01:32:23 +0100 |
commit | 3606f158bd54902930e6bda1623661b15ab1ca03 (patch) | |
tree | ebd808f7e0330ae9393f9d5b126b216744afcaa4 | |
parent | ee46dae322972b23cf9751a645dc97fbe4c5bf75 (diff) | |
download | dome-key-web-3606f158bd54902930e6bda1623661b15ab1ca03.tar.bz2 |
aquatic-prime: Sort input keys alphabetically case insensitive
Keys in the input hash must be sorted alphabetically without considering
case in order to produce the correct signature. Learned this from the
Ruby library:
total = information.sort{|a,b| a[0].downcase <=> b[0].downcase || a[0] <=> b[0]}.map{|key,value| value}.join('')
-rw-r--r-- | license-generator/aquatic-prime/src/lib.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/license-generator/aquatic-prime/src/lib.rs b/license-generator/aquatic-prime/src/lib.rs index 83d230d..6c9f997 100644 --- a/license-generator/aquatic-prime/src/lib.rs +++ b/license-generator/aquatic-prime/src/lib.rs @@ -21,7 +21,7 @@ impl<'a> AquaticPrime<'a> { let mut input_data: Vec<(&str, &str)> = input_data .into_iter() .collect(); - input_data.sort(); + input_data.sort_unstable_by_key(|el| el.0.to_lowercase()); let data = input_data .into_iter() |