From 6d6b81c88fa60565bbb6f1765e651f33b95d8371 Mon Sep 17 00:00:00 2001 From: morkt Date: Thu, 3 Dec 2015 15:51:06 +0400 Subject: [PATCH] (Binary): added RotByteR and RotByteL methods. --- GameRes/Utility.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/GameRes/Utility.cs b/GameRes/Utility.cs index f7c53052..c0ffc262 100644 --- a/GameRes/Utility.cs +++ b/GameRes/Utility.cs @@ -116,6 +116,18 @@ namespace GameRes.Utility count &= 0x1F; return v << count | v >> (32-count); } + + public static byte RotByteR (byte v, int count) + { + count &= 7; + return (byte)(v >> count | v << (8-count)); + } + + public static byte RotByteL (byte v, int count) + { + count &= 7; + return (byte)(v << count | v >> (8-count)); + } } public static class BigEndian