aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2018-11-06 01:32:23 +0100
committerTeddy Wing2018-11-06 01:32:23 +0100
commit3606f158bd54902930e6bda1623661b15ab1ca03 (patch)
treeebd808f7e0330ae9393f9d5b126b216744afcaa4
parentee46dae322972b23cf9751a645dc97fbe4c5bf75 (diff)
downloaddome-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.rs2
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()