From 0d49f91fd12167f82041178b172579ce0731a2a8 Mon Sep 17 00:00:00 2001 From: fuwa Date: Mon, 2 Dec 2019 18:12:21 +0800 Subject: [PATCH] display hash in tokens --- cyberwow/lib/config.dart | 2 +- cyberwow/lib/helper.dart | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/cyberwow/lib/config.dart b/cyberwow/lib/config.dart index 5f37e8c..5881c8c 100644 --- a/cyberwow/lib/config.dart +++ b/cyberwow/lib/config.dart @@ -33,6 +33,6 @@ const emuHost = '192.168.10.100'; const host = isEmu ? emuHost : '127.0.0.1'; -const int hashLength = 12; +const int hashViewBlock = 6; const stdoutLineBufferSize = 100; diff --git a/cyberwow/lib/helper.dart b/cyberwow/lib/helper.dart index c9b8ea6..ff6265b 100644 --- a/cyberwow/lib/helper.dart +++ b/cyberwow/lib/helper.dart @@ -32,7 +32,12 @@ String pretty(dynamic x) { ; } -String trimHash(String x) => x.substring(0, config.hashLength) + ' ...'; +String trimHash(String x) => +x.substring(0, config.hashViewBlock) ++ '-' ++ x.substring(config.hashViewBlock, config.hashViewBlock * 2) ++ ' ...'; + Map cleanKey(Map x) { final _cleaned = x.map (