2018-11-01から1ヶ月間の記事一覧

C# で AES暗号 (共通鍵暗号) を 利用 する 方法 256bit

C#

using System; using System.Security.Cryptography; public void CreateKey1(out string iv, out string key) { var BLOCK_SIZE = 128; // 128bit 固定 var KEY_SIZE = 256; // 128/192/256bit から選択 // AES暗号サービスを生成 var csp = new AesCryptoS…

URLエンコード・デコードフォーム

https://www.tagindex.com/cgi-lib/encode/url.cgi

C#で文字列のSHA-256を求める

C#

byte[] input = Encoding.ASCII.GetBytes("hogehogehoge"); SHA256 sha = new SHA256CryptoServiceProvider(); byte[] hash_sha256 = sha.ComputeHash(input); ネタ元 https://www.ipentec.com/document/csharp-get-sha256-string

C# httpclientでOAuth 2.0 認証(クライアントクレデンシャルグラント) アクセストークンもらう

C#

string client_id = "hogehoge"; // 提供される情報 string client_secret = "hogehoge_secret"; // HttpClient http_client = new HttpClient(); HttpRequestMessage request = new HttpRequestMessage(); request.Method = HttpMethod.Post; request.Reque…

Excelで数値&文字のセルから数字のみを抽出する関数

ややこしいけど関数でできる例:A1 = '50円'の場合 50と出力 =LOOKUP(10^17,LEFT(A1,COLUMN($1:$1))*1) ;A1から数字のみ"50"を抽出詳しい理屈はネタ元へ ネタ元 https://qiita.com/mhara/items/82421d1b34e88a3efba1

wordpressで自動更新ONにする方法

「function.php」に対して以下のように記述します。 //プラグインの自動更新を有効化 add_filter( 'auto_update_plugin', '__return_true' ); //テーマの自動更新を有効化 add_filter( 'auto_update_theme', '__return_true' ); //メジャーアップグレードの…